mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
block: explicitly acquire aiocontext in aio callbacks 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-16-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
1919631e6b
commit
b9e413dd37
17 changed files with 72 additions and 50 deletions
|
@ -813,7 +813,7 @@ static void bdrv_co_io_em_complete(void *opaque, int ret)
|
|||
CoroutineIOCompletion *co = opaque;
|
||||
|
||||
co->ret = ret;
|
||||
qemu_coroutine_enter(co->coroutine);
|
||||
aio_co_wake(co->coroutine);
|
||||
}
|
||||
|
||||
static int coroutine_fn bdrv_driver_preadv(BlockDriverState *bs,
|
||||
|
@ -2152,13 +2152,9 @@ static void bdrv_co_complete(BlockAIOCBCoroutine *acb)
|
|||
static void bdrv_co_em_bh(void *opaque)
|
||||
{
|
||||
BlockAIOCBCoroutine *acb = opaque;
|
||||
BlockDriverState *bs = acb->common.bs;
|
||||
AioContext *ctx = bdrv_get_aio_context(bs);
|
||||
|
||||
assert(!acb->need_bh);
|
||||
aio_context_acquire(ctx);
|
||||
bdrv_co_complete(acb);
|
||||
aio_context_release(ctx);
|
||||
}
|
||||
|
||||
static void bdrv_co_maybe_schedule_bh(BlockAIOCBCoroutine *acb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue