aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/223
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2019-03-05 12:29:08 -0600
committerEric Blake <eblake@redhat.com>2019-03-06 11:05:27 -0600
commit054be3605459d4342e9ee5a82ae0fcffeeb09e4d (patch)
tree8f7f4a06b59c5893bd104599d223deac1ebfb998 /tests/qemu-iotests/223
parentab7c5d940b223586caafc034551a5389944e0d6a (diff)
iotests: Wait for qemu to end in 223
When iotest 223 was first written, it didn't matter if we waited for the qemu process to clean up. But with the introduction of a later qemu-nbd process trying to reuse the same file, there is a race where even though the asynchronous qemu process has responded to "quit", it has not yet had time to unlock the file and exit, resulting in: -[{ "start": 0, "length": 65536, "depth": 0, "zero": false, "data": false}, -{ "start": 65536, "length": 2031616, "depth": 0, "zero": false, "data": true}, -{ "start": 2097152, "length": 2097152, "depth": 0, "zero": false, "data": false}] +qemu-nbd: Failed to blk_new_open 'tests/qemu-iotests/scratch/t.qcow2': Failed to get shared "write" lock +Is another process using the image [tests/qemu-iotests/scratch/t.qcow2]? +qemu-img: Could not open 'driver=nbd,server.type=unix,server.path=tests/qemu-iotests/scratch/qemu-nbd.sock,x-dirty-bitmap=qemu:dirty-bitmap:b': Failed to connect socket tests/qemu-iotests/scratch/qemu-nbd.sock: Connection refused +./common.nbd: line 33: kill: (11122) - No such process Fixes: ddd09448 Reported-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190305182908.13557-1-eblake@redhat.com> Tested-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/223')
-rwxr-xr-xtests/qemu-iotests/2231
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223
index f120a01646..c0a4f9c14b 100755
--- a/tests/qemu-iotests/223
+++ b/tests/qemu-iotests/223
@@ -179,6 +179,7 @@ _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-remove",
_send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "return"
_send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "error" # Again
_send_qemu_cmd $QEMU_HANDLE '{"execute":"quit"}' "return"
+wait=yes _cleanup_qemu
echo
echo "=== Use qemu-nbd as server ==="