with test while /bin/true ; do virsh snapshot-create rhel7 sleep 10 virsh snapshot-delete rhel7 --current done with enabled iothreads on a running VM leads to a lot of troubles: hangs, asserts, errors.
Anyway, I think that the construction like assert(aio_context_is_locked(aio_context)); should be widely used to ensure proper locking. Changes from v2: - droppped patch 5 as already merged - changed locking scheme in patch 4 by suggestion of Juan Changes from v1: - aio-context locking added - comment is rewritten Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Stefan Hajnoczi <stefa...@redhat.com> CC: Paolo Bonzini <pbonz...@redhat.com> fifolock: create rfifolock_is_locked helper aio_context: create aio_context_is_locked helper io: add locking constraints check into bdrv_drain to ensure locking migration: add missed aio_context_acquire into hmp_savevm/hmp_delvm async.c | 5 +++++ block/io.c | 5 ++++- block/snapshot.c | 5 +++++ include/block/aio.h | 3 +++ include/qemu/rfifolock.h | 1 + migration/savevm.c | 18 +++++++++++++++--- util/rfifolock.c | 9 +++++++-- 7 files changed, 40 insertions(+), 6 deletions(-) -- 2.1.4