From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>
Subject: [Qemu-devel] [PATCH] iotests: Make 182 do without device_add
Date: Wed, 17 Apr 2019 17:30:05 +0200 [thread overview]
Message-ID: <20190417153005.30096-1-mreitz@redhat.com> (raw)
182 fails if qemu has no support for hotplugging of a virtio-blk device.
Using an NBD server instead works just as well for the test, even on
qemus without hotplugging support.
Fixes: 6d0a4a0fb5c8f10c8eb68b52cfda0082b00ae963
Reported-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
To reintroduce the bug for which this test was written, revert the
following commits:
$ git revert -n \
23dece19da41724349809873923e20a48b619cb7 \
6ceabe6f77e4ae5ac2fa3d2ac1be11dc95021941 \
a6aeca0ca530f104b5a5dd6704fca22b2c5edefa \
577a133988c76e4ebf01d050d0d758d207a1baf7
---
tests/qemu-iotests/182 | 22 +++++++++++++++++-----
tests/qemu-iotests/182.out | 1 +
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
index ff3d7e7ec1..38959bf276 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -31,6 +31,7 @@ _cleanup()
{
_cleanup_test_img
rm -f "$TEST_IMG.overlay"
+ rm -f "$TEST_DIR/nbd.socket"
}
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -126,15 +127,26 @@ success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
'return' \
'error'
-# Now we attach the image to a virtio-blk device. This device does
-# require some permissions (at least WRITE and READ_CONSISTENT), so if
+# Start an NBD server to which we can attach node1
+success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
+ "{'execute': 'nbd-server-start',
+ 'arguments': {
+ 'addr': {
+ 'type': 'unix',
+ 'data': {
+ 'path': '$TEST_DIR/nbd.socket'
+ } } } }" \
+ 'return' \
+ 'error'
+
+# Now we attach the image to the NBD server. This server does require
+# some permissions (at least WRITE and READ_CONSISTENT), so if
# reopening node0 unshared any (which it should not have), this will
# fail (but it should not).
success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
- "{'execute': 'device_add',
+ "{'execute': 'nbd-server-add',
'arguments': {
- 'driver': 'virtio-blk',
- 'drive': 'node1'
+ 'device': 'node1'
} }" \
'return' \
'error'
diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out
index af501ca3f3..33d41eea91 100644
--- a/tests/qemu-iotests/182.out
+++ b/tests/qemu-iotests/182.out
@@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_D
{"return": {}}
{"return": {}}
{"return": {}}
+{"return": {}}
*** done
--
2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH] iotests: Make 182 do without device_add
Date: Wed, 17 Apr 2019 17:30:05 +0200 [thread overview]
Message-ID: <20190417153005.30096-1-mreitz@redhat.com> (raw)
Message-ID: <20190417153005.QnnRm_7IIK0B5wPOvCnQ9ICwBFCRCWaB7mWp0jso3d0@z> (raw)
182 fails if qemu has no support for hotplugging of a virtio-blk device.
Using an NBD server instead works just as well for the test, even on
qemus without hotplugging support.
Fixes: 6d0a4a0fb5c8f10c8eb68b52cfda0082b00ae963
Reported-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
To reintroduce the bug for which this test was written, revert the
following commits:
$ git revert -n \
23dece19da41724349809873923e20a48b619cb7 \
6ceabe6f77e4ae5ac2fa3d2ac1be11dc95021941 \
a6aeca0ca530f104b5a5dd6704fca22b2c5edefa \
577a133988c76e4ebf01d050d0d758d207a1baf7
---
tests/qemu-iotests/182 | 22 +++++++++++++++++-----
tests/qemu-iotests/182.out | 1 +
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182
index ff3d7e7ec1..38959bf276 100755
--- a/tests/qemu-iotests/182
+++ b/tests/qemu-iotests/182
@@ -31,6 +31,7 @@ _cleanup()
{
_cleanup_test_img
rm -f "$TEST_IMG.overlay"
+ rm -f "$TEST_DIR/nbd.socket"
}
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -126,15 +127,26 @@ success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
'return' \
'error'
-# Now we attach the image to a virtio-blk device. This device does
-# require some permissions (at least WRITE and READ_CONSISTENT), so if
+# Start an NBD server to which we can attach node1
+success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
+ "{'execute': 'nbd-server-start',
+ 'arguments': {
+ 'addr': {
+ 'type': 'unix',
+ 'data': {
+ 'path': '$TEST_DIR/nbd.socket'
+ } } } }" \
+ 'return' \
+ 'error'
+
+# Now we attach the image to the NBD server. This server does require
+# some permissions (at least WRITE and READ_CONSISTENT), so if
# reopening node0 unshared any (which it should not have), this will
# fail (but it should not).
success_or_failure=y _send_qemu_cmd $QEMU_HANDLE \
- "{'execute': 'device_add',
+ "{'execute': 'nbd-server-add',
'arguments': {
- 'driver': 'virtio-blk',
- 'drive': 'node1'
+ 'device': 'node1'
} }" \
'return' \
'error'
diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out
index af501ca3f3..33d41eea91 100644
--- a/tests/qemu-iotests/182.out
+++ b/tests/qemu-iotests/182.out
@@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=qcow2 size=197120 backing_file=TEST_D
{"return": {}}
{"return": {}}
{"return": {}}
+{"return": {}}
*** done
--
2.20.1
next reply other threads:[~2019-04-17 15:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 15:30 Max Reitz [this message]
2019-04-17 15:30 ` [Qemu-devel] [PATCH] iotests: Make 182 do without device_add Max Reitz
2019-04-17 15:39 ` Eric Blake
2019-04-17 15:39 ` Eric Blake
2019-04-25 16:31 ` Alberto Garcia
2019-04-25 16:31 ` Alberto Garcia
2019-05-07 13:21 ` Max Reitz
2019-05-07 15:04 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190417153005.30096-1-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).