Re: [Qemu-block] [PATCH v2 10/11] qemu-iotests/141: Avoid blockdev-add with id

2016-09-20 Thread Eric Blake
On 09/20/2016 08:03 AM, Kevin Wolf wrote:
> We want to remove the 'id' option for blockdev-add. This removes one
> user of the option and makes it use only node names.
> 
> Signed-off-by: Kevin Wolf 
> ---
>  tests/qemu-iotests/141 | 24 ++--
>  tests/qemu-iotests/141.out | 24 
>  2 files changed, 26 insertions(+), 22 deletions(-)
> 

> +++ b/tests/qemu-iotests/141.out
> @@ -9,30 +9,30 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 
> backing_file=TEST_DIR/m.
>  {"return": {}}
>  Formatting 'TEST_DIR/o.IMGFMT', fmt=IMGFMT size=1048576 
> backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
>  {"return": {}}
> -{"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: block 
> device is in use by block job: backup"}}
> +{"error": {"class": "GenericError", "desc": "Node drv0 is in use by (null)"}}

Are we calling printf("%s",NULL) (not portable) or
printf("%s","(null)")?  At any rate, is the poorer error message quality
intentional? I'd feel more comfortable if we knew why the error message
regressed, before giving R-b here.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


[Qemu-block] [PATCH v2 10/11] qemu-iotests/141: Avoid blockdev-add with id

2016-09-20 Thread Kevin Wolf
We want to remove the 'id' option for blockdev-add. This removes one
user of the option and makes it use only node names.

Signed-off-by: Kevin Wolf 
---
 tests/qemu-iotests/141 | 24 ++--
 tests/qemu-iotests/141.out | 24 
 2 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/tests/qemu-iotests/141 b/tests/qemu-iotests/141
index b2617e5..c092d87 100755
--- a/tests/qemu-iotests/141
+++ b/tests/qemu-iotests/141
@@ -51,7 +51,7 @@ test_blockjob()
 "{'execute': 'blockdev-add',
   'arguments': {
   'options': {
-  'id': 'drv0',
+  'node-name': 'drv0',
   'driver': '$IMGFMT',
   'file': {
   'driver': 'file',
@@ -66,18 +66,18 @@ test_blockjob()
 
 # We want this to return an error because the block job is still running
 _send_qemu_cmd $QEMU_HANDLE \
-"{'execute': 'x-blockdev-remove-medium',
-  'arguments': {'device': 'drv0'}}" \
+"{'execute': 'x-blockdev-del',
+  'arguments': {'node-name': 'drv0'}}" \
 'error'
 
 _send_qemu_cmd $QEMU_HANDLE \
 "{'execute': 'block-job-cancel',
-  'arguments': {'device': 'drv0'}}" \
+  'arguments': {'device': 'job0'}}" \
 "$3"
 
 _send_qemu_cmd $QEMU_HANDLE \
 "{'execute': 'x-blockdev-del',
-  'arguments': {'id': 'drv0'}}" \
+  'arguments': {'node-name': 'drv0'}}" \
 'return'
 }
 
@@ -101,7 +101,8 @@ echo
 
 test_blockjob \
 "{'execute': 'drive-backup',
-  'arguments': {'device': 'drv0',
+  'arguments': {'job-id': 'job0',
+'device': 'drv0',
 'target': '$TEST_DIR/o.$IMGFMT',
 'format': '$IMGFMT',
 'sync': 'none'}}" \
@@ -117,7 +118,8 @@ echo
 
 test_blockjob \
 "{'execute': 'drive-mirror',
-  'arguments': {'device': 'drv0',
+  'arguments': {'job-id': 'job0',
+'device': 'drv0',
 'target': '$TEST_DIR/o.$IMGFMT',
 'format': '$IMGFMT',
 'sync': 'none'}}" \
@@ -134,7 +136,7 @@ echo
 
 test_blockjob \
 "{'execute': 'block-commit',
-  'arguments': {'device': 'drv0'}}" \
+  'arguments': {'job-id': 'job0', 'device': 'drv0'}}" \
 'BLOCK_JOB_READY' \
 'BLOCK_JOB_COMPLETED'
 
@@ -150,7 +152,8 @@ $QEMU_IO -c 'write 0 1M' "$TEST_DIR/m.$IMGFMT" | 
_filter_qemu_io
 
 test_blockjob \
 "{'execute': 'block-commit',
-  'arguments': {'device': 'drv0',
+  'arguments': {'job-id': 'job0',
+'device': 'drv0',
 'top':'$TEST_DIR/m.$IMGFMT',
 'speed':  1}}" \
 'return' \
@@ -172,7 +175,8 @@ $QEMU_IO -c 'write 0 1M' "$TEST_DIR/b.$IMGFMT" | 
_filter_qemu_io
 
 test_blockjob \
 "{'execute': 'block-stream',
-  'arguments': {'device': 'drv0',
+  'arguments': {'job-id': 'job0',
+'device': 'drv0',
 'speed': 1}}" \
 'return' \
 'BLOCK_JOB_CANCELLED'
diff --git a/tests/qemu-iotests/141.out b/tests/qemu-iotests/141.out
index eaf1e60..da9e841 100644
--- a/tests/qemu-iotests/141.out
+++ b/tests/qemu-iotests/141.out
@@ -9,30 +9,30 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 
backing_file=TEST_DIR/m.
 {"return": {}}
 Formatting 'TEST_DIR/o.IMGFMT', fmt=IMGFMT size=1048576 
backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
 {"return": {}}
-{"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: block device 
is in use by block job: backup"}}
+{"error": {"class": "GenericError", "desc": "Node drv0 is in use by (null)"}}
 {"return": {}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"BLOCK_JOB_CANCELLED", "data": {"device": "drv0", "len": 1048576, "offset": 0, 
"speed": 0, "type": "backup"}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"BLOCK_JOB_CANCELLED", "data": {"device": "job0", "len": 1048576, "offset": 0, 
"speed": 0, "type": "backup"}}
 {"return": {}}
 
 === Testing drive-mirror ===
 
 {"return": {}}
 Formatting 'TEST_DIR/o.IMGFMT', fmt=IMGFMT size=1048576 
backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"BLOCK_JOB_READY", "data": {"device": "drv0", "len": 0, "offset": 0, "speed": 
0, "type": "mirror"}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"BLOCK_JOB_READY", "data": {"device": "job0", "len": 0, "offset": 0, "speed": 
0, "type": "mirror"}}
 {"return": {}}
-{"error": {"class": "GenericError", "desc": "Node 'drv0' is busy: block device 
is in use by block job: mirror"}}
+{"error": {"class": "GenericError", "desc": "Node drv0 is in use by (null)"}}
 {"return": {}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": 
"BLOCK_JOB_COMPLETED", "data":