mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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:
parent
ae23dde9dd
commit
aa1361d54a
3 changed files with 25 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue