summaryrefslogtreecommitdiff
path: root/block/nfs.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2018-01-18 13:43:45 +0100
committerKevin Wolf <kwolf@redhat.com>2018-03-02 18:39:07 +0100
commitefc75e2a4cf7dfa62c7ccaa9a1016f27e5519003 (patch)
treed1e5f6e34343a39664427910234fdd7eaf1875b9 /block/nfs.c
parent13471a40c13bc899c73f1879681da29da292547e (diff)
block: rename .bdrv_create() to .bdrv_co_create_opts()
BlockDriver->bdrv_create() has been called from coroutine context since commit 5b7e1542cfa41a281af9629d31cef03704d976e6 ("block: make bdrv_create adopt coroutine"). Make this explicit by renaming to .bdrv_co_create_opts() and add the coroutine_fn annotation. This makes it obvious to block driver authors that they may yield, use CoMutex, or other coroutine_fn APIs. bdrv_co_create is reserved for the QAPI-based version that Kevin is working on. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20170705102231.20711-2-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/nfs.c')
-rw-r--r--block/nfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/nfs.c b/block/nfs.c
index 6576a73d6e..ce6e195a41 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -684,7 +684,8 @@ static QemuOptsList nfs_create_opts = {
}
};
-static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp)
+static int coroutine_fn nfs_file_co_create_opts(const char *url, QemuOpts *opts,
+ Error **errp)
{
int64_t ret, total_size;
NFSClient *client = g_new0(NFSClient, 1);
@@ -897,7 +898,7 @@ static BlockDriver bdrv_nfs = {
.bdrv_file_open = nfs_file_open,
.bdrv_close = nfs_file_close,
- .bdrv_create = nfs_file_create,
+ .bdrv_co_create_opts = nfs_file_co_create_opts,
.bdrv_reopen_prepare = nfs_reopen_prepare,
.bdrv_co_preadv = nfs_co_preadv,