yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
4ec855
From 58bf58e416a89ea5166865664887cfe4562b1fc0 Mon Sep 17 00:00:00 2001
4ec855
From: Max Reitz <mreitz@redhat.com>
4ec855
Date: Wed, 26 Jun 2019 16:24:01 +0100
4ec855
Subject: [PATCH 2/2] iotests: Make 182 do without device_add
4ec855
MIME-Version: 1.0
4ec855
Content-Type: text/plain; charset=UTF-8
4ec855
Content-Transfer-Encoding: 8bit
4ec855
4ec855
RH-Author: Max Reitz <mreitz@redhat.com>
4ec855
Message-id: <20190626162401.11112-2-mreitz@redhat.com>
4ec855
Patchwork-id: 88951
4ec855
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH 1/1] iotests: Make 182 do without device_add
4ec855
Bugzilla: 1707598
4ec855
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
4ec855
RH-Acked-by: John Snow <jsnow@redhat.com>
4ec855
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
4ec855
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4ec855
4ec855
182 fails if qemu has no support for hotplugging of a virtio-blk device.
4ec855
Using an NBD server instead works just as well for the test, even on
4ec855
qemus without hotplugging support.
4ec855
4ec855
Fixes: 6d0a4a0fb5c8f10c8eb68b52cfda0082b00ae963
4ec855
Reported-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
Signed-off-by: Max Reitz <mreitz@redhat.com>
4ec855
Message-Id: <20190417153005.30096-1-mreitz@redhat.com>
4ec855
Tested-by: Eric Blake <eblake@redhat.com>
4ec855
Reviewed-by: Eric Blake <eblake@redhat.com>
4ec855
Acked-by: Alberto Garcia <berto@igalia.com>
4ec855
Signed-off-by: Eric Blake <eblake@redhat.com>
4ec855
(cherry picked from commit 8fabb8be37775ebb32b0d78bc7be815a29b8a107)
4ec855
Signed-off-by: Max Reitz <mreitz@redhat.com>
4ec855
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
---
4ec855
 tests/qemu-iotests/182     | 22 +++++++++++++++++-----
4ec855
 tests/qemu-iotests/182.out |  1 +
4ec855
 2 files changed, 18 insertions(+), 5 deletions(-)
4ec855
4ec855
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
4ec855
index 3b7689c..c1520ed 100755
4ec855
--- a/tests/qemu-iotests/182
4ec855
+++ b/tests/qemu-iotests/182
4ec855
@@ -32,6 +32,7 @@ _cleanup()
4ec855
 {
4ec855
     _cleanup_test_img
4ec855
     rm -f "$TEST_IMG.overlay"
4ec855
+    rm -f "$TEST_DIR/nbd.socket"
4ec855
 }
4ec855
 trap "_cleanup; exit \$status" 0 1 2 3 15
4ec855
 
4ec855
@@ -127,15 +128,26 @@ success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
4ec855
     'return' \
4ec855
     'error'
4ec855
 
4ec855
-# Now we attach the image to a virtio-blk device.  This device does
4ec855
-# require some permissions (at least WRITE and READ_CONSISTENT), so if
4ec855
+# Start an NBD server to which we can attach node1
4ec855
+success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
4ec855
+    "{'execute': 'nbd-server-start',
4ec855
+      'arguments': {
4ec855
+          'addr': {
4ec855
+              'type': 'unix',
4ec855
+              'data': {
4ec855
+                  'path': '$TEST_DIR/nbd.socket'
4ec855
+              } } } }" \
4ec855
+    'return' \
4ec855
+    'error'
4ec855
+
4ec855
+# Now we attach the image to the NBD server.  This server does require
4ec855
+# some permissions (at least WRITE and READ_CONSISTENT), so if
4ec855
 # reopening node0 unshared any (which it should not have), this will
4ec855
 # fail (but it should not).
4ec855
 success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
4ec855
-    "{'execute': 'device_add',
4ec855
+    "{'execute': 'nbd-server-add',
4ec855
       'arguments': {
4ec855
-          'driver': 'virtio-blk',
4ec855
-          'drive': 'node1'
4ec855
+          'device': 'node1'
4ec855
       } }" \
4ec855
     'return' \
4ec855
     'error'
4ec855
diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out
4ec855
index af501ca..33d41ee 100644
4ec855
--- a/tests/qemu-iotests/182.out
4ec855
+++ b/tests/qemu-iotests/182.out
4ec855
@@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_D
4ec855
 {"return": {}}
4ec855
 {"return": {}}
4ec855
 {"return": {}}
4ec855
+{"return": {}}
4ec855
 *** done
4ec855
-- 
4ec855
1.8.3.1
4ec855