block: Add missing locking in bdrv_co_drain_bh_cb()
bdrv_do_drained_begin/end() assume that they are called with the AioContext lock of bs held. If we call drain functions from a coroutine with the AioContext lock held, we yield and schedule a BH to move out of coroutine context. This means that the lock for the home context of the coroutine is released and must be re-acquired in the bottom half. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
@@ -198,3 +198,8 @@ bool qemu_coroutine_entered(Coroutine *co)
|
||||
{
|
||||
return co->caller;
|
||||
}
|
||||
|
||||
AioContext *coroutine_fn qemu_coroutine_get_aio_context(Coroutine *co)
|
||||
{
|
||||
return co->ctx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user