[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/4] iotests: Wait for qemu to end in 223
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PULL 4/4] iotests: Wait for qemu to end in 223 |
Date: |
Fri, 8 Mar 2019 11:39:58 -0600 |
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 <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Tested-by: Alberto Garcia <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/223 | 1 +
tests/qemu-iotests/223.out | 1 +
2 files changed, 2 insertions(+)
diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223
index f120a016460..c0a4f9c14b7 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 ==="
diff --git a/tests/qemu-iotests/223.out b/tests/qemu-iotests/223.out
index 6476b77ba20..95c40a17ad7 100644
--- a/tests/qemu-iotests/223.out
+++ b/tests/qemu-iotests/223.out
@@ -89,6 +89,7 @@ read 2097152/2097152 bytes at offset 2097152
{"return": {}}
{"error": {"class": "GenericError", "desc": "NBD server not running"}}
{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event":
"SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
=== Use qemu-nbd as server ===
--
2.20.1
- [Qemu-devel] [PULL 0/4] NBD patches for 2019-03-08, 4.0 softfreeze, Eric Blake, 2019/03/08
- [Qemu-devel] [PULL 3/4] nbd: fix outdated qapi docs syntax for tls-creds, Eric Blake, 2019/03/08
- [Qemu-devel] [PULL 2/4] nbd: allow authorization with nbd-server-start QMP command, Eric Blake, 2019/03/08
- [Qemu-devel] [PULL 4/4] iotests: Wait for qemu to end in 223,
Eric Blake <=
- [Qemu-devel] [PULL 1/4] qemu-nbd: add support for authorization of TLS clients, Eric Blake, 2019/03/08
- Re: [Qemu-devel] [PULL 0/4] NBD patches for 2019-03-08, 4.0 softfreeze, Peter Maydell, 2019/03/10