diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-13 14:52:31 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-02-21 11:39:39 +0000 |
commit | 1919631e6b5562e474690853eca3c35610201e16 (patch) | |
tree | f2a7e1da7d7d0ad988faa4801309a45a68c78b60 /block/block-backend.c | |
parent | 9d456654482a8bd1ff72f0bdbe1f393149a5680a (diff) | |
download | qemu-1919631e6b5562e474690853eca3c35610201e16.zip qemu-1919631e6b5562e474690853eca3c35610201e16.tar.gz qemu-1919631e6b5562e474690853eca3c35610201e16.tar.bz2 |
block: explicitly acquire aiocontext in bottom halves that need it
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-15-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r-- | block/block-backend.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index 1177598..bfc0e6b 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -939,9 +939,12 @@ int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags) static void error_callback_bh(void *opaque) { struct BlockBackendAIOCB *acb = opaque; + AioContext *ctx = bdrv_get_aio_context(acb->common.bs); bdrv_dec_in_flight(acb->common.bs); + aio_context_acquire(ctx); acb->common.cb(acb->common.opaque, acb->ret); + aio_context_release(ctx); qemu_aio_unref(acb); } @@ -983,9 +986,12 @@ static void blk_aio_complete(BlkAioEmAIOCB *acb) static void blk_aio_complete_bh(void *opaque) { BlkAioEmAIOCB *acb = opaque; + AioContext *ctx = bdrv_get_aio_context(acb->common.bs); assert(acb->has_returned); + aio_context_acquire(ctx); blk_aio_complete(acb); + aio_context_release(ctx); } static BlockAIOCB *blk_aio_prwv(BlockBackend *blk, int64_t offset, int bytes, |