Blame SOURCES/kvm-iotests-Wait-for-qemu-to-end-in-223.patch

7711c0
From e5d7e4bd2388cebecc64469ea957676caba9bbe1 Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Wed, 27 Mar 2019 17:23:07 +0100
7711c0
Subject: [PATCH 129/163] iotests: Wait for qemu to end in 223
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190327172308.31077-55-jsnow@redhat.com>
7711c0
Patchwork-id: 85219
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 54/55] iotests: Wait for qemu to end in 223
7711c0
Bugzilla: 1691009
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
7711c0
From: Eric Blake <eblake@redhat.com>
7711c0
7711c0
When iotest 223 was first written, it didn't matter if we waited for
7711c0
the qemu process to clean up. But with the introduction of a later
7711c0
qemu-nbd process trying to reuse the same file, there is a race where
7711c0
even though the asynchronous qemu process has responded to "quit", it
7711c0
has not yet had time to unlock the file and exit, resulting in:
7711c0
7711c0
-[{ "start": 0, "length": 65536, "depth": 0, "zero": false, "data": false},
7711c0
-{ "start": 65536, "length": 2031616, "depth": 0, "zero": false, "data": true},
7711c0
-{ "start": 2097152, "length": 2097152, "depth": 0, "zero": false, "data": false}]
7711c0
+qemu-nbd: Failed to blk_new_open 'tests/qemu-iotests/scratch/t.qcow2': Failed to get shared "write" lock
7711c0
+Is another process using the image [tests/qemu-iotests/scratch/t.qcow2]?
7711c0
+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
7711c0
+./common.nbd: line 33: kill: (11122) - No such process
7711c0
7711c0
Fixes: ddd09448
7711c0
Reported-by: Alberto Garcia <berto@igalia.com>
7711c0
Signed-off-by: Eric Blake <eblake@redhat.com>
7711c0
Message-Id: <20190305182908.13557-1-eblake@redhat.com>
7711c0
Tested-by: Alberto Garcia <berto@igalia.com>
7711c0
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
7711c0
(cherry picked from commit 054be3605459d4342e9ee5a82ae0fcffeeb09e4d)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 tests/qemu-iotests/223     | 1 +
7711c0
 tests/qemu-iotests/223.out | 1 +
7711c0
 2 files changed, 2 insertions(+)
7711c0
7711c0
diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223
7711c0
index f120a01..c0a4f9c 100755
7711c0
--- a/tests/qemu-iotests/223
7711c0
+++ b/tests/qemu-iotests/223
7711c0
@@ -179,6 +179,7 @@ _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-remove",
7711c0
 _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "return"
7711c0
 _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-stop"}' "error" # Again
7711c0
 _send_qemu_cmd $QEMU_HANDLE '{"execute":"quit"}' "return"
7711c0
+wait=yes _cleanup_qemu
7711c0
 
7711c0
 echo
7711c0
 echo "=== Use qemu-nbd as server ==="
7711c0
diff --git a/tests/qemu-iotests/223.out b/tests/qemu-iotests/223.out
7711c0
index 963ae28..0524ffb 100644
7711c0
--- a/tests/qemu-iotests/223.out
7711c0
+++ b/tests/qemu-iotests/223.out
7711c0
@@ -89,6 +89,7 @@ read 2097152/2097152 bytes at offset 2097152
7711c0
 {"return": {}}
7711c0
 {"error": {"class": "GenericError", "desc": "NBD server not running"}}
7711c0
 {"return": {}}
7711c0
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}
7711c0
 
7711c0
 === Use qemu-nbd as server ===
7711c0
 
7711c0
-- 
7711c0
1.8.3.1
7711c0