This series fixes an issue where qemu_aio_flush() would return to IDE hardware emulation with requests still pending. Kevin Wolf <kw...@redhat.com> found it in the block tree before qemu.git/master merge, so qemu.git/master is not affected and these patches are against his tree.
A recent interaction between copy-on-read and "qcow2: Unlock during COW" emphasized the need for strong assertion checking. Patch 1 fixes an assertion failure with qcow2 images in hw/ide/pci.c:bmdma_cmd_writeb(). Patches 2 and 3 then introduce assertions that detect wait_for_overlapping_requests() deadlock and broken qemu_aio_wait(). In the future we will have better information if issues related to qemu_aio_wait() come up. I have run qemu-iotests for qcow2 and qed. I have also performed a RHEL6 guest install to qed and tested booting the guest with IDE and qcow2. Stefan Hajnoczi (3): qcow2: avoid reentrant bdrv_read() in copy_sectors() block: wait_for_overlapping_requests() deadlock detection block: convert qemu_aio_flush() calls to bdrv_drain_all() block-migration.c | 2 +- block.c | 27 +++++++++++++++++++++++++++ block.h | 1 + block/qcow2-cluster.c | 27 +++++++++++++++++++-------- blockdev.c | 4 ++-- cpus.c | 2 +- hw/ide/macio.c | 5 +++-- hw/ide/pci.c | 2 +- hw/virtio-blk.c | 2 +- hw/xen_platform.c | 2 +- qemu-io.c | 4 ++-- savevm.c | 2 +- xen-mapcache.c | 2 +- 13 files changed, 61 insertions(+), 21 deletions(-) -- 1.7.7.3