See patch 1 for the code-based explanation, and patch 2 for a case where this bites in practice.
v2: - Remove test artifacts that remained from testing the test (Sorry...) git backport-diff against v1: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/2:[----] [--] 'block/io: Delay decrementing the quiesce_counter' 002/2:[0004] [FC] 'iotests: Test cancelling a job and closing the VM' Max Reitz (2): block/io: Delay decrementing the quiesce_counter iotests: Test cancelling a job and closing the VM block/io.c | 3 ++- tests/qemu-iotests/255 | 52 ++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/255.out | 24 ++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) -- 2.21.0