qemu/include/block
Fam Zheng 794f01414f blockjob: Fix hang in block_job_finish_sync
With a mirror job running on a virtio-blk dataplane disk, sending "q" to
HMP will cause a dead loop in block_job_finish_sync.

This is because the aio_poll() only processes the AIO context of bs
which has no more work to do, while the main loop BH that is scheduled
for setting the job->completed flag is never processed.

Fix this by adding a flag in BlockJob structure, to track which context
to poll for the block job to make progress. Its value is set to true
when block_job_coroutine_complete() is called, and is checked in
block_job_finish_sync to determine which context to poll.

Suggested-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1454379144-29807-1-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-09 13:52:26 +00:00
..
accounting.h block: Update copyright of the accounting code 2015-11-12 16:22:47 +01:00
aio.h aio: Introduce aio-epoll.c 2015-11-09 09:59:47 +00:00
block_int.h block: Add "file" output parameter to block status query functions 2016-02-02 17:50:47 +01:00
block.h block: set device_list.tqe_prev to NULL on BDS removal 2016-02-02 18:04:47 +01:00
blockjob.h blockjob: Fix hang in block_job_finish_sync 2016-02-09 13:52:26 +00:00
nbd.h nbd: Always call "close_fn" in nbd_client_new 2016-01-15 18:58:01 +01:00
qapi.h qmp: fill in the image field in BlockDeviceInfo 2015-04-28 15:36:09 +02:00
scsi.h typofixes - v4 2015-09-11 10:45:43 +03:00
snapshot.h migration: implement bdrv_all_find_vmstate_bs helper 2015-11-19 11:50:00 +01:00
thread-pool.h block: Rename BlockDriverCompletionFunc to BlockCompletionFunc 2014-10-20 13:41:27 +02:00
throttle-groups.h throttle: Remove throttle_group_lock/unlock() 2015-10-23 18:18:23 +02:00
write-threshold.h block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00