mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
blockjob: Wake up BDS when job becomes idle
In the context of draining a BDS, the .drained_poll callback of block jobs is called. If this returns true (i.e. there is still some activity pending), the drain operation may call aio_poll() with blocking=true to wait for completion. As soon as the pending activity is completed and the job finally arrives in a quiescent state (i.e. its coroutine either yields with busy=false or terminates), the block job must notify the aio_poll() loop to wake up, otherwise we get a deadlock if both are running in different threads. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
d1756c780b
commit
34dc97b9a0
4 changed files with 41 additions and 0 deletions
|
@ -156,6 +156,9 @@ typedef struct Job {
|
|||
/** Notifiers called when the job transitions to READY */
|
||||
NotifierList on_ready;
|
||||
|
||||
/** Notifiers called when the job coroutine yields or terminates */
|
||||
NotifierList on_idle;
|
||||
|
||||
/** Element of the list of jobs */
|
||||
QLIST_ENTRY(Job) job_list;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue