diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-13 14:52:30 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-02-21 11:39:36 +0000 |
commit | 9d456654482a8bd1ff72f0bdbe1f393149a5680a (patch) | |
tree | fbebb64735b7996ae8abade0d02c725e225d603d /block/nfs.c | |
parent | 2f47da5f7f88d3966a2cb33cc9de53f134fea367 (diff) |
block: explicitly acquire aiocontext in callbacks that need it
This covers both file descriptor callbacks and polling callbacks,
since they execute related code.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170213135235.12274-14-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/nfs.c')
-rw-r--r-- | block/nfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/nfs.c b/block/nfs.c index 689eaa792e..5ce968cd57 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -208,15 +208,21 @@ static void nfs_set_events(NFSClient *client) static void nfs_process_read(void *arg) { NFSClient *client = arg; + + aio_context_acquire(client->aio_context); nfs_service(client->context, POLLIN); nfs_set_events(client); + aio_context_release(client->aio_context); } static void nfs_process_write(void *arg) { NFSClient *client = arg; + + aio_context_acquire(client->aio_context); nfs_service(client->context, POLLOUT); nfs_set_events(client); + aio_context_release(client->aio_context); } static void nfs_co_init_task(BlockDriverState *bs, NFSRPC *task) |