mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
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>
This commit is contained in:
parent
9d45665448
commit
1919631e6b
17 changed files with 71 additions and 28 deletions
|
@ -189,7 +189,7 @@ static void bdrv_co_drain_bh_cb(void *opaque)
|
|||
bdrv_dec_in_flight(bs);
|
||||
bdrv_drained_begin(bs);
|
||||
data->done = true;
|
||||
qemu_coroutine_enter(co);
|
||||
aio_co_wake(co);
|
||||
}
|
||||
|
||||
static void coroutine_fn bdrv_co_yield_to_drain(BlockDriverState *bs)
|
||||
|
@ -2152,9 +2152,13 @@ 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