Skip to contentSkip to conversation

Update tests/qemu-iotests failing cases for the s390 platform

RFC PATCH In review Xiao Guang Chen 4 participants 20 messages Apr 23, 2015 – May 4, 2015

lore
Share & tools
lore
#0 lore raw

v7 cover Update tests/qemu-iotests failing cases for the s390 platform

From: Bo Tu <[email protected]>

v7.
1. Add a pc specific output file for test 130.
2. A new variable device_id is defined in test 130 to support multiplatform.
3. Update the output file for test 051 based on it's current output.
4. test 049 failed in s390x platform while specifying a negtive size using -o option when create an image. A new patch was generated to solve this problem.

v6.
1. Change the filter name from _filter_s390 to _filter_orphan.
2. Update the output file for tese case 081 because no default floopy and cd-rom.

v5:
1. Add a pc specific output file for test 051.
2. Add a filter to test case 051 to filter s390 specific warnings.
3. Check whether the machine type is pc or not rather than check whether the machine type is s390.
4. When using a machine specific reference file if the default machine has an alias then use the alias as the output file name otherwise use the default machine name as the output file name.

v4:
1. Generate all patches based on the latest master branch.
2. Rearrange patches

v3:
1. Fix a typo in v2.

v2:
1. Drop the patches for test 039 for it has been fixed in upstream.
2. Integrate patches for test 071, 067 and 087.
3. Keep the other patches.

v1:
1. updated the test suite to be default-machine-type-aware, from the previous platform-aware
2. created a new patch "qemu-iotests: run qemu with -nodefaults" to counterpart the impact from the commit:
c88930a6866e74953e931ae749781e98e486e5c8
qemu-char: Permit only a single "stdio" character device

When more than one is used, the terminal settings aren't restored correctly on exit. Fixable. However, such usage makes no sense, because the users race for input, so outlaw it instead.

If you want to connect multiple things to stdio, use the mux chardev.
3. updated all the checking of platform name to the current machine name

Bo Tu (1):
qemu-iotests-s390x-fix-test-130

Xiao Guang Chen (5):
qemu-iotests: qemu machine type support
qemu-iotests: run qemu with -nodefaults and fix 067,071,081 and 087
qemu-iotests: s390x: fix test 041
qemu-iotests: s390x: fix test 055
qemu-iotests: s390x: fix test 051

root (1):
qemu-iotests: fix test case 049

 tests/qemu-iotests/041           |   6 +
 tests/qemu-iotests/049.out       |  10 +-
 tests/qemu-iotests/051           |  79 ++++---
 tests/qemu-iotests/051.out       | 156 +++++---------
 tests/qemu-iotests/051.pc.out    | 433 +++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/055           |   9 +
 tests/qemu-iotests/067           |   8 +-
 tests/qemu-iotests/067.out       | 266 +-----------------------
 tests/qemu-iotests/071.out       |   4 -
 tests/qemu-iotests/081.out       |   2 -
 tests/qemu-iotests/087.out       |  12 --
 tests/qemu-iotests/130           |  13 +-
 tests/qemu-iotests/130.out       |   4 +-
 tests/qemu-iotests/130.pc.out    |  43 ++++
 tests/qemu-iotests/check         |   5 +
 tests/qemu-iotests/common        |   1 +
 tests/qemu-iotests/common.config |  11 +-
 tests/qemu-iotests/common.filter |   7 +
 tests/qemu-iotests/common.qemu   |   2 +-
 tests/qemu-iotests/iotests.py    |   1 +
 util/qemu-option.c               |   4 +
 21 files changed, 647 insertions(+), 429 deletions(-)
 create mode 100644 tests/qemu-iotests/051.pc.out
 create mode 100644 tests/qemu-iotests/130.pc.out
Signature · 1 line
2.3.0
#1 lore raw

RFC PATCH v7 1/7 qemu-iotests: qemu machine type support

This patch adds qemu machine type support to the io test suite. Based on the qemu default machine type and alias of the default machine type the reference output file can now vary from the default to a machine specific output file if necessary. When using a machine specific reference file if the default machine has an alias then use the alias as the output file name otherwise use the default machine name as the output file name.

---
 tests/qemu-iotests/check         | 5 +++++
 tests/qemu-iotests/common.config | 9 +++++++++
 tests/qemu-iotests/iotests.py    | 1 +
 3 files changed, 15 insertions(+)
tests/qemu-iotests/check +5 -0
index baeae80..22b2e63 100755
@@ -324,6 +324,11 @@ do
             fi
 
             reference="$source_iotests/$seq.out"
+            reference_machine="$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out"
+            if [ -f "$reference_machine" ]; then
+                reference="$reference_machine"
+            fi
+
             if [ "$CACHEMODE" = "none" ]; then
                 [ -f "$source_iotests/$seq.out.nocache" ] && reference="$source_iotests/$seq.out.nocache"
             fi
tests/qemu-iotests/common.config +9 -0
index a1973ad..0288cb1 100644
@@ -107,6 +107,15 @@ export QEMU=$QEMU_PROG
 export QEMU_IMG=$QEMU_IMG_PROG
 export QEMU_IO="$QEMU_IO_PROG $QEMU_IO_OPTIONS"
 export QEMU_NBD=$QEMU_NBD_PROG
+default_machine=$($QEMU -machine \? | awk '/(default)/{print $1}')
+default_alias_machine=$($QEMU -machine \? |\
+    awk -v var_default_machine="$default_machine"\)\
+    '{if ($(NF-2)=="(alias"&&$(NF-1)=="of"&&$(NF)==var_default_machine){print $1}}')
+if [ ! -z "$default_alias_machine" ]; then
+    default_machine="$default_alias_machine"
+fi
+
+export QEMU_DEFAULT_MACHINE="$default_machine"
 
 [ -f /etc/qemu-iotest.config ]       && . /etc/qemu-iotest.config
 
tests/qemu-iotests/iotests.py +1 -0
index 1402854..36917bd 100644
@@ -42,6 +42,7 @@ imgproto = os.environ.get('IMGPROTO', 'file')
 test_dir = os.environ.get('TEST_DIR', '/var/tmp')
 output_dir = os.environ.get('OUTPUT_DIR', '.')
 cachemode = os.environ.get('CACHEMODE')
+qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE')
 
 socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')
 
Signature · 1 line
2.3.0
#2 lore raw

RFC PATCH v7 2/7 qemu-iotests: run qemu with -nodefaults and fix 067, 071, 081 and 087

In reply to Xiao Guang Chen

This patch fixes an io test suite issue that was introduced with the commit c88930a6866e74953e931ae749781e98e486e5c8 'qemu-char: Permit only a single "stdio" character device'. The option supresses the creation of default devices such as the floopy and cdrom. Output files for test case 067, 071, 081 and 087 need to be updated to accommodate this change. Use virtio-blk instead of virtio-blk-pci as the device driver for test case
067. For virtio-blk-pci is the same with virtio-blk as device driver but other platform such as s390 may not recognize the virtio-blk-pci.

---
 tests/qemu-iotests/067           |   8 +-
 tests/qemu-iotests/067.out       | 266 +--------------------------------------
 tests/qemu-iotests/071.out       |   4 -
 tests/qemu-iotests/081.out       |   2 -
 tests/qemu-iotests/087.out       |  12 --
 tests/qemu-iotests/common        |   1 +
 tests/qemu-iotests/common.config |   2 +-
 tests/qemu-iotests/common.qemu   |   2 +-
 8 files changed, 8 insertions(+), 289 deletions(-)
tests/qemu-iotests/067 +4 -4
index 83eefa3..3e9a053 100755
@@ -59,7 +59,7 @@ echo
 echo === -drive/-device and device_del ===
 echo
 
-run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk -device virtio-blk-pci,drive=disk,id=virtio0 <<EOF
+run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk -device virtio-blk,drive=disk,id=virtio0 <<EOF
 { "execute": "qmp_capabilities" }
 { "execute": "query-block" }
 { "execute": "device_del", "arguments": { "id": "virtio0" } }
@@ -76,7 +76,7 @@ run_qemu -drive file=$TEST_IMG,format=$IMGFMT,if=none,id=disk <<EOF
 { "execute": "qmp_capabilities" }
 { "execute": "query-block" }
 { "execute": "device_add",
-   "arguments": { "driver": "virtio-blk-pci", "drive": "disk",
+   "arguments": { "driver": "virtio-blk", "drive": "disk",
                   "id": "virtio0" } }
 { "execute": "device_del", "arguments": { "id": "virtio0" } }
 { "execute": "system_reset" }
@@ -94,7 +94,7 @@ run_qemu <<EOF
   "arguments": { "command-line": "drive_add 0 file=$TEST_IMG,format=$IMGFMT,if=none,id=disk" } }
 { "execute": "query-block" }
 { "execute": "device_add",
-   "arguments": { "driver": "virtio-blk-pci", "drive": "disk",
+   "arguments": { "driver": "virtio-blk", "drive": "disk",
                   "id": "virtio0" } }
 { "execute": "device_del", "arguments": { "id": "virtio0" } }
 { "execute": "system_reset" }
@@ -122,7 +122,7 @@ run_qemu <<EOF
   }
 { "execute": "query-block" }
 { "execute": "device_add",
-   "arguments": { "driver": "virtio-blk-pci", "drive": "disk",
+   "arguments": { "driver": "virtio-blk", "drive": "disk",
                   "id": "virtio0" } }
 { "execute": "device_del", "arguments": { "id": "virtio0" } }
 { "execute": "system_reset" }
tests/qemu-iotests/067.out +1 -265

343 lines not on this page · raw message

tests/qemu-iotests/071.out +0 -4
index 9205ce2..8d2095a 100644
@@ -50,8 +50,6 @@ read failed: Input/output error
 {"return": ""}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 QEMU_PROG: Failed to flush the L2 table cache: Input/output error
 QEMU_PROG: Failed to flush the refcount block cache: Input/output error
 
@@ -90,8 +88,6 @@ read failed: Input/output error
 {"return": ""}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 QEMU_PROG: Failed to flush the L2 table cache: Input/output error
 QEMU_PROG: Failed to flush the refcount block cache: Input/output error
 
tests/qemu-iotests/081.out +0 -2
index 9f57d9d..692c4a4 100644
@@ -36,8 +36,6 @@ read 10485760/10485760 bytes at offset 0
 {"return": ""}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 == using quorum rewrite corrupted mode ==
tests/qemu-iotests/087.out +0 -12
index c71bb3a..c509a40 100644
@@ -9,8 +9,6 @@ QMP_VERSION
 {"error": {"class": "GenericError", "desc": "Block device needs an ID"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === Duplicate ID ===
@@ -26,8 +24,6 @@ QMP_VERSION
 {"error": {"class": "GenericError", "desc": "node-name=disk3 is conflicting with a device id"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === aio=native without O_DIRECT ===
@@ -38,8 +34,6 @@ QMP_VERSION
 {"error": {"class": "GenericError", "desc": "aio=native requires cache.direct=true"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === Encrypted image ===
@@ -60,8 +54,6 @@ You can use 'qemu-img convert' to convert your image to an unencrypted one.
 {"error": {"class": "GenericError", "desc": "blockdev-add doesn't support encrypted devices"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 Testing:
 QMP_VERSION
@@ -72,8 +64,6 @@ You can use 'qemu-img convert' to convert your image to an unencrypted one.
 {"error": {"class": "GenericError", "desc": "Guest must be stopped for opening of encrypted image"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 
 === Missing driver ===
@@ -91,7 +81,5 @@ QMP_VERSION
 {"error": {"class": "GenericError", "desc": "Invalid parameter type for 'driver', expected: string"}}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN"}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
 
 *** done
tests/qemu-iotests/common +1 -0
index 1e556bb..ed26d79 100644
@@ -51,6 +51,7 @@ export IMGOPTS=""
 export CACHEMODE="writeback"
 export QEMU_IO_OPTIONS=""
 export CACHEMODE_IS_DEFAULT=true
+export QEMU_OPTIONS="-nodefaults"
 
 for r
 do
tests/qemu-iotests/common.config +1 -1
index 0288cb1..e0bf896 100644
@@ -103,7 +103,7 @@ if [ -z "$QEMU_NBD_PROG" ]; then
     export QEMU_NBD_PROG="`set_prog_path qemu-nbd`"
 fi
 
-export QEMU=$QEMU_PROG
+export QEMU="$QEMU_PROG $QEMU_OPTIONS"
 export QEMU_IMG=$QEMU_IMG_PROG
 export QEMU_IO="$QEMU_IO_PROG $QEMU_IO_OPTIONS"
 export QEMU_NBD=$QEMU_NBD_PROG
tests/qemu-iotests/common.qemu +1 -1
index 4e1996c..e3faa53 100644
@@ -153,7 +153,7 @@ function _launch_qemu()
     mkfifo "${fifo_out}"
     mkfifo "${fifo_in}"
 
-    "${QEMU}" -nographic -serial none ${comm} -machine accel=qtest "${@}" \
+    ${QEMU} -nographic -serial none ${comm} -machine accel=qtest "${@}" \
                                                                 >"${fifo_out}" \
                                                                 2>&1 \
                                                                 <"${fifo_in}" &
Signature · 1 line
2.3.0
#3 lore raw

RFC PATCH v7 3/7 qemu-iotests: s390x: fix test 041

In reply to Xiao Guang Chen

There is no 'ide-cd' device defined on s390 platform, so test_medium_not_found() test should be skipped.

---
 tests/qemu-iotests/041 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/qemu-iotests/041 +6 -0
index 59a8f73..c6abe3c 100755
@@ -197,6 +197,9 @@ class TestSingleDrive(ImageMirroringTestCase):
                         'target image does not match source after mirroring')
 
     def test_medium_not_found(self):
+        if iotests.qemu_default_machine != 'pc':
+            return
+
         result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full',
                              target=target_img)
         self.assert_qmp(result, 'error/class', 'GenericError')
@@ -867,6 +870,9 @@ class TestRepairQuorum(ImageMirroringTestCase):
         if not self.has_quorum():
             return
 
+        if iotests.qemu_default_machine != 'pc':
+            return
+
         result = self.vm.qmp('drive-mirror', device='ide1-cd0', sync='full',
                              node_name='repair0',
                              replaces='img1',
Signature · 1 line
2.3.0
#4 lore raw

RFC PATCH v7 4/7 qemu-iotests: s390x: fix test 055

In reply to Xiao Guang Chen

There is no 'ide-cd' device defined on s390 platform, so test_medium_not_found() test should be skipped.

---
 tests/qemu-iotests/055 | 9 +++++++++
 1 file changed, 9 insertions(+)
tests/qemu-iotests/055 +9 -0
index 017a609..e6e0ac4 100755
@@ -104,11 +104,17 @@ class TestSingleDrive(iotests.QMPTestCase):
         self.do_test_pause('blockdev-backup', 'drive1', blockdev_target_img)
 
     def test_medium_not_found(self):
+        if iotests.qemu_default_machine != 'pc':
+            return
+
         result = self.vm.qmp('drive-backup', device='ide1-cd0',
                              target=target_img, sync='full')
         self.assert_qmp(result, 'error/class', 'GenericError')
 
     def test_medium_not_found_blockdev_backup(self):
+        if iotests.qemu_default_machine != 'pc':
+            return
+
         result = self.vm.qmp('blockdev-backup', device='ide1-cd0',
                              target='drive1', sync='full')
         self.assert_qmp(result, 'error/class', 'GenericError')
@@ -323,6 +329,9 @@ class TestSingleTransaction(iotests.QMPTestCase):
         self.do_test_pause('blockdev-backup', 'drive1', blockdev_target_img)
 
     def do_test_medium_not_found(self, cmd, target):
+        if iotests.qemu_default_machine != 'pc':
+            return
+
         result = self.vm.qmp('transaction', actions=[{
                 'type': cmd,
                 'data': { 'device': 'ide1-cd0',
Signature · 1 line
2.3.0
#5 lore raw

RFC PATCH v7 5/7 qemu-iotests: s390x: fix test 049

In reply to Xiao Guang Chen

From: Bo Tu <[email protected]>

when creating an image qemu-img enable us specifying the size of the image using -o size=xx options. But when we specify an invalid size such as a negtive size then different platform gives different result.

parse_option_size() function in util/qemu-option.c will be called to parse the size, a cast was called in the function to cast the input (saved as a double in the function) size to an unsigned int64 value, when the input is a negtive value or exceeds the maximum of uint64, then the result is undefined.

Language spec 6.3.1.4 Real floating and integers:
the result of this assignment/cast is undefined if the float is not in the open interval (-1, U<type>_MAX+1).

---
 tests/qemu-iotests/049.out | 10 ++++------
 util/qemu-option.c         |  5 +++++
 2 files changed, 9 insertions(+), 6 deletions(-)
tests/qemu-iotests/049.out +4 -6
index 9f93666..75d90b2 100644
@@ -95,17 +95,15 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
 qemu-img: Image size must be less than 8 EiB!
 
 qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
 
 qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
 qemu-img: Image size must be less than 8 EiB!
 
 qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
 
 qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
 qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
util/qemu-option.c +5 -0
index fda4e5f..1c50fa4 100644
@@ -179,6 +179,11 @@ void parse_option_size(const char *name, const char *value,
 
     if (value != NULL) {
         sizef = strtod(value, &postfix);
+        if (sizef < 0 || sizef > UINT64_MAX) {
+            error_set(errp, QERR_INVALID_PARAMETER_VALUE, name, "a positive "
+                       "number and must not exceeds the maximum UINT64");
+            return;
+        }
         switch (*postfix) {
         case 'T':
             sizef *= 1024;
Signature · 1 line
2.3.0
#6 lore raw

Re: [Qemu-devel] [PATCH RFC v7 5/7] qemu-iotests: s390x: fix test 049

Quoted 1 line · Xiao Guang Chen

From: Bo Tu <[email protected]>

Hm, why is Bo Tu the patch author, but doesn't have an S-o-b in the commit message?

Quoted 10 lines

when creating an image qemu-img enable us specifying the size of the image using -o size=xx options. But when we specify an invalid size such as a negtive size then different platform gives different result.

parse_option_size() function in util/qemu-option.c will be called to parse the size, a cast was called in the function to cast the input (saved as a double in the function) size to an unsigned int64 value, when the input is a negtive value or exceeds the maximum of uint64, then the result is undefined.

Quoted 3 lines

Language spec 6.3.1.4 Real floating and integers:
the result of this assignment/cast is undefined if the float is not in the open interval (-1, U<type>_MAX+1).

Thank you for pointing to the specific section. I guess there are always new things to discover in C...

Quoted 37 lines
---
  tests/qemu-iotests/049.out | 10 ++++------
  util/qemu-option.c         |  5 +++++
  2 files changed, 9 insertions(+), 6 deletions(-)
tests/qemu-iotests/049.out +4 -6
index 9f93666..75d90b2 100644
@@ -95,17 +95,15 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
  qemu-img: Image size must be less than 8 EiB!
 
  qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
 
  qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
  qemu-img: Image size must be less than 8 EiB!
 
  qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
 
  qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
  qemu-img: Invalid image size specified! You may use k, M, G, T, P or E suffixes for
util/qemu-option.c +0 -0
index fda4e5f..1c50fa4 100644

util/qemu-option.c void parse_option_size(const char *name, const char *value, · line 184

Quoted 6 lines
util/qemu-option.c +3 -0
@@ -179,6 +179,11 @@ void parse_option_size(const char *name, const char *value,
 
      if (value != NULL) {
          sizef = strtod(value, &postfix);
+        if (sizef < 0 || sizef > UINT64_MAX) {
+            error_set(errp, QERR_INVALID_PARAMETER_VALUE, name, "a positive "
+                       "number and must not exceeds the maximum UINT64");

I think Markus would like to see these error macros not getting used anymore, so I think it should be dropped and the full string should be given here. I'll let him do the arguing, though. :-)

If you keep the macro, I'd propose "a non-negative number below 2^64" (or actually give the decimal value of UINT64_MAX, using 'a non-negative number not exceeding "%" PRIu64, UINT64_MAX'). Remember that 0 is not positive, but still a valid choice.

If you drop the macro, I'd propose error_setg(errp, "'%s' must be a non-negative number below 2^64", name) or, like it is now, error_setg(errp, "Parameter '%s' expects a non-negative number below 2^64", name).

Max

Quoted 5 lines
util/qemu-option.c +2 -0
+            return;
+        }
          switch (*postfix) {
          case 'T':
              sizef *= 1024;
#7 lore raw

Re: [Qemu-devel] [PATCH RFC v7 5/7] qemu-iotests: s390x: fix test 049

Hello Max:

Xiao Guang Chen left IBM last week, and I took over this job. thanks for your comments :-)

Quoted 4 lines · Max Reitz
Quoted 1 line · Xiao Guang Chen

From: Bo Tu <[email protected]>

Hm, why is Bo Tu the patch author, but doesn't have an S-o-b in the commit message?

I created the patch, but faild to send out it via 'git send-email". So XiaoGuang sent the patch with his account on his machine. Perhaps that's the reason.

Quoted 67 lines
Quoted 10 lines

when creating an image qemu-img enable us specifying the size of the image using -o size=xx options. But when we specify an invalid size such as a negtive size then different platform gives different result.

parse_option_size() function in util/qemu-option.c will be called to parse the size, a cast was called in the function to cast the input (saved as a double in the function) size to an unsigned int64 value, when the input is a negtive value or exceeds the maximum of uint64, then the result is undefined.

Quoted 3 lines

Language spec 6.3.1.4 Real floating and integers:
the result of this assignment/cast is undefined if the float is not in the open interval (-1, U<type>_MAX+1).

Thank you for pointing to the specific section. I guess there are always new things to discover in C...

Quoted 45 lines
---
  tests/qemu-iotests/049.out | 10 ++++------
  util/qemu-option.c         |  5 +++++
  2 files changed, 9 insertions(+), 6 deletions(-)
tests/qemu-iotests/049.out +0 -2
index 9f93666..75d90b2 100644
@@ -95,17 +95,15 @@ qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1024
  qemu-img: Image size must be less than 8 EiB!
    qemu-img create -f qcow2 -o size=-1024 TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not 

supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 +qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64

tests/qemu-iotests/049.out +1 -2
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
    qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- -1k
  qemu-img: Image size must be less than 8 EiB!
    qemu-img create -f qcow2 -o size=-1k TEST_DIR/t.qcow2
-qemu-img: qcow2 doesn't support shrinking images yet
-qemu-img: TEST_DIR/t.qcow2: Could not resize image: Operation not 

supported
-Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=-1024 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 +qemu-img: Parameter 'size' expects a positive number and must not exceeds the maximum UINT64
+qemu-img: TEST_DIR/t.qcow2: Invalid options for file format 'qcow2'
qemu-img create -f qcow2 TEST_DIR/t.qcow2 -- 1kilobyte
qemu-img: Invalid image size specified! You may use k, M, G, T, P
or E suffixes for

util/qemu-option.c +2 -0
index fda4e5f..1c50fa4 100644
@@ -179,6 +179,11 @@ void parse_option_size(const char *name, const 
 char *value,
        if (value != NULL) {
          sizef = strtod(value, &postfix);
+        if (sizef < 0 || sizef > UINT64_MAX) {
+            error_set(errp, QERR_INVALID_PARAMETER_VALUE, name, "a 
Quoted 3 lines

positive "
+ "number and must not exceeds the maximum
UINT64");

I think Markus would like to see these error macros not getting used anymore, so I think it should be dropped and the full string should be given here. I'll let him do the arguing, though. :-)

Quoted 1 line

If you keep the macro, I'd propose "a non-negative number below 2^64" (or actually give the decimal value of UINT64_MAX, using 'a non-negative number not exceeding "%" PRIu64, UINT64_MAX'). Remember that 0 is not positive, but still a valid choice.

Good suggestion. I'll change the error message like "a non-negative number not exceeding "%" PRIu64, UINT64_MAX')" in v8.

Quoted 11 lines

If you drop the macro, I'd propose error_setg(errp, "'%s' must be a non-negative number below 2^64", name) or, like it is now, error_setg(errp, "Parameter '%s' expects a non-negative number below 2^64", name).

Max

Quoted 5 lines
util/qemu-option.c +2 -0
+            return;
+        }
          switch (*postfix) {
          case 'T':
              sizef *= 1024;
#8 lore raw

RFC PATCH v7 6/7 qemu-iotests: s390x: fix test 051

In reply to Xiao Guang Chen

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.
A new filter was added to filter orphan warnings.

---
 tests/qemu-iotests/051           |  79 ++++---
 tests/qemu-iotests/051.out       | 156 +++++---------
 tests/qemu-iotests/051.pc.out    | 433 +++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/common.filter |   7 +
 4 files changed, 545 insertions(+), 130 deletions(-)
 create mode 100644 tests/qemu-iotests/051.pc.out
tests/qemu-iotests/051 +50 -29
index 0360f37..8de16a5 100755
@@ -147,13 +147,19 @@ run_qemu -drive if=ide
 run_qemu -drive if=virtio
 run_qemu -drive if=scsi
 
-run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
-
-run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
-run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
+
+        run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
+        run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
 
 echo
 echo === Read-only ===
@@ -167,13 +173,19 @@ run_qemu -drive file="$TEST_IMG",if=ide,readonly=on
 run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on
 run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on
 
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
 
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
 
 echo
 echo === Cache modes ===
@@ -182,12 +194,12 @@ echo
 # Cannot use the test image because cache=none might not work on the host FS
 # Use cdrom so that we won't get errors about missing media
 
-run_qemu -drive media=cdrom,cache=none
-run_qemu -drive media=cdrom,cache=directsync
-run_qemu -drive media=cdrom,cache=writeback
-run_qemu -drive media=cdrom,cache=writethrough
-run_qemu -drive media=cdrom,cache=unsafe
-run_qemu -drive media=cdrom,cache=invalid_value
+run_qemu -drive if=scsi,media=cdrom,cache=none
+run_qemu -drive if=scsi,media=cdrom,cache=directsync
+run_qemu -drive if=scsi,media=cdrom,cache=writeback
+run_qemu -drive if=scsi,media=cdrom,cache=writethrough
+run_qemu -drive if=scsi,media=cdrom,cache=unsafe
+run_qemu -drive if=scsi,media=cdrom,cache=invalid_value
 
 echo
 echo === Specifying the protocol layer ===
@@ -251,28 +263,37 @@ echo
 echo === Snapshot mode ===
 echo
 
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;
+esac
+
 $QEMU_IO -c "write -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
 
 # Opening a read-only file r/w with snapshot=on
 chmod u-w "$TEST_IMG"
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
 chmod u+w "$TEST_IMG"
 
 $QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io
 
 $QEMU_IO -c "read -P 0x22 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo -e 'qemu-io ide0-hd0 "write -P 0x33 0 4k"\ncommit ide0-hd0' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo -e "qemu-io $device_id \"write -P 0x33 0 4k\"\ncommit $device_id" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
 
 $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io
 
tests/qemu-iotests/051.out +49 -95

276 lines not on this page · raw message

Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr! ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit

Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr! ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit

Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr! ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
@@ -413,7 +367,7 @@ read 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr! ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
@@ -422,10 +376,10 @@ read 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w! rite -P 0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x3qemu-io virtio0 "write -P 0x33qemu-io virtio0 "wr! ite -P 0x33 qemu-io virtio0 "write -P 0x33 0qemu-io virtio0 "write -P 0x33 0 qemu-io virtio0 "write -P 0x33 0 4qemu-io virtio0 "write -P 0x33 0 4kqemu-io virtio0 "write -P 0x33 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
(qemu) qququiquit

read 4096/4096 bytes at offset 0

tests/qemu-iotests/051.pc.out new file +358 -0

358 lines not on this page · raw message

qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w! rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w! rite -P 0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done

tests/qemu-iotests/common.filter +7 -0
index 012a812..db86fd7 100644
@@ -154,9 +154,16 @@ _filter_qemu_io()
         -e "s/qemu-io> //g"
 }
 
+# removes orphan warnings
+_filter_orphan()
+{
+    sed -e 's/ Warning: Orphaned drive without device:.*$//g'
+}
+
 # replace occurrences of QEMU_PROG with "qemu"
 _filter_qemu()
 {
+    _filter_orphan | \
     sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
         -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
         -e '/main-loop: WARNING: I\/O thread spun for [0-9]\+ iterations/d' \
Signature · 1 line
2.3.0
#9 lore raw

Re: [Qemu-devel] [PATCH RFC v7 6/7] qemu-iotests: s390x: fix test 051

Quoted 168 lines · Xiao Guang Chen

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.
A new filter was added to filter orphan warnings.

---
  tests/qemu-iotests/051           |  79 ++++---
  tests/qemu-iotests/051.out       | 156 +++++---------
  tests/qemu-iotests/051.pc.out    | 433 +++++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/common.filter |   7 +
  4 files changed, 545 insertions(+), 130 deletions(-)

create mode 100644 tests/qemu-iotests/051.pc.out

tests/qemu-iotests/051 +50 -29
index 0360f37..8de16a5 100755
@@ -147,13 +147,19 @@ run_qemu -drive if=ide
  run_qemu -drive if=virtio
  run_qemu -drive if=scsi
 
-run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
-
-run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
-run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
+
+        run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
+        run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
 
  echo
  echo === Read-only ===
@@ -167,13 +173,19 @@ run_qemu -drive file="$TEST_IMG",if=ide,readonly=on
  run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on
  run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on
 
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
 
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
 
  echo
  echo === Cache modes ===
@@ -182,12 +194,12 @@ echo
  # Cannot use the test image because cache=none might not work on the host FS
  # Use cdrom so that we won't get errors about missing media
 
-run_qemu -drive media=cdrom,cache=none
-run_qemu -drive media=cdrom,cache=directsync
-run_qemu -drive media=cdrom,cache=writeback
-run_qemu -drive media=cdrom,cache=writethrough
-run_qemu -drive media=cdrom,cache=unsafe
-run_qemu -drive media=cdrom,cache=invalid_value
+run_qemu -drive if=scsi,media=cdrom,cache=none
+run_qemu -drive if=scsi,media=cdrom,cache=directsync
+run_qemu -drive if=scsi,media=cdrom,cache=writeback
+run_qemu -drive if=scsi,media=cdrom,cache=writethrough
+run_qemu -drive if=scsi,media=cdrom,cache=unsafe
+run_qemu -drive if=scsi,media=cdrom,cache=invalid_value
 
  echo
  echo === Specifying the protocol layer ===
@@ -251,28 +263,37 @@ echo
  echo === Snapshot mode ===
  echo
 
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;
+esac
+
  $QEMU_IO -c "write -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
 
  # Opening a read-only file r/w with snapshot=on
  chmod u-w "$TEST_IMG"
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
  chmod u+w "$TEST_IMG"
 
  $QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io
 
  $QEMU_IO -c "read -P 0x22 0 4k" "$TEST_IMG" | _filter_qemu_io
 
-echo -e 'qemu-io ide0-hd0 "write -P 0x33 0 4k"\ncommit ide0-hd0' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo -e "qemu-io $device_id \"write -P 0x33 0 4k\"\ncommit $device_id" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
 
  $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io
 
tests/qemu-iotests/051.out +4 -4
index 2890eac..63e0e81 100644
@@ -5,16 +5,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR
  === Unknown option ===
 
  Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
 
  Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
 
  Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
 
  Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
 
 
  === Unknown protocol option ===

tests/qemu-iotests/051.out QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif · line 54

Quoted 6 lines
tests/qemu-iotests/051.out +1 -2
@@ -51,8 +51,7 @@ QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
 
  Testing: -device virtio-scsi-pci -device scsi-hd
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device scsi-hd: drive property not set
-QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
+(qemu) QEMU_PROG: -device virtio-scsi-pci: No 'PCI' bus found for device 'virtio-scsi-pci'

This change looks like you'd rather just disable this test for non-PCI systems. Also, it's a change from v6 which forces me to remind you to please remove Reviewed-by statements from the commit message if there are functional changes in a patch from the previously reviewed version.

(Because just like in this case, the reviewer (i.e., me) may find some of these changes questionable, or might even outright object them.)

Max

Quoted 797 lines
tests/qemu-iotests/051.out +44 -89
  === Overriding backing file ===
@@ -60,7 +59,7 @@ QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
  Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig -nodefaults
  QEMU X.Y.Z monitor - type 'help' for more information
  (qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block
-ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
+virtio0: TEST_DIR/t.qcow2 (qcow2)
      Cache mode:       writeback
      Backing file:     TEST_DIR/t.qcow2.orig (chain depth: 1)
  (qemu) qququiquit
@@ -110,79 +109,56 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
  Testing: -drive if=floppy
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive if=ide,media=cdrom
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive if=scsi,media=cdrom
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive if=ide
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Device needs media, but drive is empty
-QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
+(qemu)
+qququiquit
 
  Testing: -drive if=virtio
  QEMU X.Y.Z monitor - type 'help' for more information
  (qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
-QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
+QEMU_PROG: -drive if=virtio: Device 'virtio-blk-s390' could not be initialized
 
  Testing: -drive if=scsi
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device needs media, but drive is empty
-
-Testing: -drive if=none,id=disk -device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive if=none,id=disk -device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
-
-Testing: -drive if=none,id=disk -device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
-QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
+(qemu)
+qququiquit
 
 
  === Read-only ===
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Can't use a read-only drive
-QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
+(qemu)
+qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
@@ -190,61 +166,39 @@ QEMU X.Y.Z monitor - type 'help' for more information
 
  Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
-QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
-QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
 
  === Cache modes ===
 
-Testing: -drive media=cdrom,cache=none
+Testing: -drive if=scsi,media=cdrom,cache=none
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
-Testing: -drive media=cdrom,cache=directsync
+Testing: -drive if=scsi,media=cdrom,cache=directsync
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
-Testing: -drive media=cdrom,cache=writeback
+Testing: -drive if=scsi,media=cdrom,cache=writeback
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
-Testing: -drive media=cdrom,cache=writethrough
+Testing: -drive if=scsi,media=cdrom,cache=writethrough
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
-Testing: -drive media=cdrom,cache=unsafe
+Testing: -drive if=scsi,media=cdrom,cache=unsafe
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
 
-Testing: -drive media=cdrom,cache=invalid_value
-QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
+Testing: -drive if=scsi,media=cdrom,cache=invalid_value
+QEMU_PROG: -drive if=scsi,media=cdrom,cache=invalid_value: invalid cache option
 
 
  === Specifying the protocol layer ===
@@ -355,56 +309,56 @@ wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2 -snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 

Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +4 -4
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
 
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!
  ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  (qemu) qququiquit
@@ -413,7 +367,7 @@ read 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write -P 0x22qemu-io virtio0 "wr!

ite -P 0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k" wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit

tests/qemu-iotests/051.out +2 -2
@@ -422,10 +376,10 @@ read 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w!
  rite -P 0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k"
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
  qemu-io virtio0 "writeqemu-io virtio0 "write qemu-io virtio0 "write -qemu-io virtio0 "write -Pqemu-io virtio0 "write -P qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x3qemu-io virtio0 "write -P 0x33qemu-io virtio0 "wr!
  ite -P 0x33 qemu-io virtio0 "write -P 0x33 0qemu-io virtio0 "write -P 0x33 0 qemu-io virtio0 "write -P 0x33 0 4qemu-io virtio0 "write -P 0x33 0 4kqemu-io virtio0 "write -P 0x33 0 4k"
  wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
  (qemu) qququiquit
 
  read 4096/4096 bytes at offset 0
tests/qemu-iotests/051.pc.out new file +433 -0
new file mode 100644
index 0000000..4c9224d
@@ -0,0 +1,433 @@
+QA output created by 051
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file='TEST_DIR/t.IMGFMT.base'
+
+=== Unknown option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+
+
+=== Unknown protocol option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo: Block protocol 'file' doesn't support the option 'unknown_opt'
+
+
+=== Invalid format ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: Unknown driver 'foo'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2: Cannot specify both 'driver' and 'format'
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specify both 'driver' and 'format'
+
+
+=== Device without drive ===
+
+Testing: -device virtio-scsi-pci -device scsi-hd
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd: drive property not set
+QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
+
+
+=== Overriding backing file ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig -nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) iininfinfoinfo info binfo blinfo bloinfo blocinfo block
+ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
+    Cache mode:       writeback
+    Backing file:     TEST_DIR/t.qcow2.orig (chain depth: 1)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files
+
+
+=== Enable and disable lazy refcounting on the command line, plus some invalid values ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: Parameter 'lazy-refcounts' expects 'on' or 'off'
+
+
+=== With version 2 images enabling lazy refcounts must fail ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+
+=== No medium ===
+
+Testing: -drive if=floppy
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=ide,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=ide
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Device needs media, but drive is empty
+QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
+
+Testing: -drive if=virtio
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is empty
+QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
+
+Testing: -drive if=scsi
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device needs media, but drive is empty
+
+Testing: -drive if=none,id=disk -device ide-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=none,id=disk -device ide-drive,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
+
+Testing: -drive if=none,id=disk -device ide-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-disk,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, but drive is empty
+QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized
+
+
+=== Read-only ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Can't use a read-only drive
+QEMU_PROG: Initialization of device ide-hd failed: Device initialization failed.
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-drive,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a read-only drive
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device ide-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only drive
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be initialized
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+
+=== Cache modes ===
+
+Testing: -drive if=scsi,media=cdrom,cache=none
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=directsync
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writeback
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writethrough
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=unsafe
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=invalid_value
+QEMU_PROG: -drive if=scsi,media=cdrom,cache=invalid_value: invalid cache option
+
+
+=== Specifying the protocol layer ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: Block format 'qcow2' used by device '' doesn't support the option 'filename'
+
+
+=== Leaving out required options ===
+
+Testing: -drive driver=file
+QEMU_PROG: -drive driver=file: The 'file' block driver requires a file name
+
+Testing: -drive driver=nbd
+QEMU_PROG: -drive driver=nbd: one of path and host must be specified.
+
+Testing: -drive driver=raw
+QEMU_PROG: -drive driver=raw: Can't use 'raw' as a block driver for the protocol level
+
+Testing: -drive file.driver=file
+QEMU_PROG: -drive file.driver=file: The 'file' block driver requires a file name
+
+Testing: -drive file.driver=nbd
+QEMU_PROG: -drive file.driver=nbd: one of path and host must be specified.
+
+Testing: -drive file.driver=raw
+QEMU_PROG: -drive file.driver=raw: Can't use 'raw' as a block driver for the protocol level
+
+Testing: -drive foo=bar
+QEMU_PROG: -drive foo=bar: Must specify either driver or file
+
+
+=== Specifying both an option and its legacy alias ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678: 'throttling.iops-total' and its alias 'iops' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678: 'throttling.iops-read' and its alias 'iops_rd' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678: 'throttling.iops-write' and its alias 'iops_wr' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678: 'throttling.bps-total' and its alias 'bps' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678: 'throttling.bps-read' and its alias 'bps_rd' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678: 'throttling.bps-write' and its alias 'bps_wr' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678: 'throttling.iops-total-max' and its alias 'iops_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678: 'throttling.iops-read-max' and its alias 'iops_rd_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678: 'throttling.iops-write-max' and its alias 'iops_wr_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678: 'throttling.bps-total-max' and its alias 'bps_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678: 'throttling.bps-read-max' and its alias 'bps_rd_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678: 'throttling.bps-write-max' and its alias 'bps_wr_max' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678: 'throttling.iops-size' and its alias 'iops_size' can't be used at the same time
+
+Testing: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off: 'read-only' and its alias 'readonly' can't be used at the same time
+
+
+=== Parsing protocol from file name ===
+
+Testing: -hda foo:bar
+QEMU_PROG: -hda foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file=foo:bar
+QEMU_PROG: -drive file=foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file.filename=foo:bar
+QEMU_PROG: -drive file.filename=foo:bar: Could not open 'foo:bar': No such file or directory
+
+Testing: -hda file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file.filename=file:TEST_DIR/t.qcow2
+QEMU_PROG: -drive file.filename=file:TEST_DIR/t.qcow2: Could not open 'file:TEST_DIR/t.qcow2': No such file or directory
+
+
+=== Snapshot mode ===
+
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!
  rite -P 0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
  qemu-io ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write -qemu-io ide0-hd0 "write -Pqemu-io ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w!
  rite -P 0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k"
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
tests/qemu-iotests/common.filter +7 -0
index 012a812..db86fd7 100644
@@ -154,9 +154,16 @@ _filter_qemu_io()
          -e "s/qemu-io> //g"
  }
 
+# removes orphan warnings
+_filter_orphan()
+{
+    sed -e 's/ Warning: Orphaned drive without device:.*$//g'
+}
+
  # replace occurrences of QEMU_PROG with "qemu"
  _filter_qemu()
  {
+    _filter_orphan | \
      sed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \
          -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \
          -e '/main-loop: WARNING: I\/O thread spun for [0-9]\+ iterations/d' \
#10 lore raw

Re: [Qemu-devel] [PATCH RFC v7 6/7] qemu-iotests: s390x: fix test 051

Hi Max:

Quoted 207 lines · Max Reitz
Quoted 202 lines · Xiao Guang Chen

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.
A new filter was added to filter orphan warnings.

---
  tests/qemu-iotests/051           |  79 ++++---
  tests/qemu-iotests/051.out       | 156 +++++---------
  tests/qemu-iotests/051.pc.out    | 433 
+++++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/common.filter |   7 +
  4 files changed, 545 insertions(+), 130 deletions(-)

create mode 100644 tests/qemu-iotests/051.pc.out

tests/qemu-iotests/051 +0 -1
index 0360f37..8de16a5 100755
@@ -147,13 +147,19 @@ run_qemu -drive if=ide
  run_qemu -drive if=virtio
  run_qemu -drive if=scsi
  -run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051 +0 -4
-
-run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
-run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk

tests/qemu-iotests/051 +4 -0
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051 +4 -0
+
+        run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
+        run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk
+ run_qemu -drive if=none,id=disk -device lsi53c895a -device
scsi-hd,drive=disk

tests/qemu-iotests/051 +4 -0
+        ;;
+    *)
+        ;;
+esac
    echo
  echo === Read-only ===
@@ -167,13 +173,19 @@ run_qemu -drive 

file="$TEST_IMG",if=ide,readonly=on
run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on -run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on

tests/qemu-iotests/051 +0 -2
-device ide-cd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device 

lsi53c895a -device scsi-cd,drive=disk

tests/qemu-iotests/051 +4 -4
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-cd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-cd,drive=disk
  -run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-drive,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device 

ide-hd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk

tests/qemu-iotests/051 +8 -4
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-drive,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-hd,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-disk,drive=disk
+        run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
    echo
  echo === Cache modes ===
@@ -182,12 +194,12 @@ echo
  # Cannot use the test image because cache=none might not work on 

the host FS
# Use cdrom so that we won't get errors about missing media -run_qemu -drive media=cdrom,cache=none

tests/qemu-iotests/051 +14 -5
-run_qemu -drive media=cdrom,cache=directsync
-run_qemu -drive media=cdrom,cache=writeback
-run_qemu -drive media=cdrom,cache=writethrough
-run_qemu -drive media=cdrom,cache=unsafe
-run_qemu -drive media=cdrom,cache=invalid_value
+run_qemu -drive if=scsi,media=cdrom,cache=none
+run_qemu -drive if=scsi,media=cdrom,cache=directsync
+run_qemu -drive if=scsi,media=cdrom,cache=writeback
+run_qemu -drive if=scsi,media=cdrom,cache=writethrough
+run_qemu -drive if=scsi,media=cdrom,cache=unsafe
+run_qemu -drive if=scsi,media=cdrom,cache=invalid_value
    echo
  echo === Specifying the protocol layer ===
@@ -251,28 +263,37 @@ echo
  echo === Snapshot mode ===
  echo
  +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;
+esac
+
  $QEMU_IO -c "write -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
  -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive 

file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io +echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io +echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
# Opening a read-only file r/w with snapshot=on
chmod u-w "$TEST_IMG"
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
chmod u+w "$TEST_IMG"

    $QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io

-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive
file="$TEST_IMG",snapshot=off | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io

    $QEMU_IO -c "read -P 0x22 0 4k" "$TEST_IMG" | _filter_qemu_io

-echo -e 'qemu-io ide0-hd0 "write -P 0x33 0 4k"\ncommit ide0-hd0' |
run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io +echo -e "qemu-io $device_id \"write -P 0x33 0 4k\"\ncommit $device_id" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io

    $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io

diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 2890eac..63e0e81 100644

tests/qemu-iotests/051.out +0 -0
@@ -5,16 +5,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT 

size=134217728 backing_file='TEST_DIR
=== Unknown option ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=:
Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=:
Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on:
Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on:
Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'

    Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234

-QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
-QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'

      === Unknown protocol option ===
tests/qemu-iotests/051.out +0 -0
@@ -51,8 +51,7 @@ QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
Testing: -device virtio-scsi-pci -device scsi-hd
QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +1 -2
-(qemu) QEMU_PROG: -device scsi-hd: drive property not set
-QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
+(qemu) QEMU_PROG: -device virtio-scsi-pci: No 'PCI' bus found for 
Quoted 1 line

device 'virtio-scsi-pci'

This change looks like you'd rather just disable this test for non-PCI systems. Also, it's a change from v6 which forces me to remind you to please remove Reviewed-by statements from the commit message if there are functional changes in a patch from the previously reviewed version.

Quoted 3 lines

(Because just like in this case, the reviewer (i.e., me) may find some of these changes questionable, or might even outright object them.)

Max

1. Sure. will remove Reviewed-by statements if any functional changes in a new patch version. thanks for the reminder
2. Test 051 will be executed for PCI systems like x86, and test 051 will be executed for non-PCI systems like s390x as well. However, its golden test data is different(051.out is for s390x, 051.pc.out is for x86) Test steps are different between PCI systems and non-PCI systems.
For instance, the tests for device type "ide_cd" should only be tested for the pc platform, and be disabled for non-PCI systems.

Quoted 1,199 lines
Quoted 1,198 lines

=== Overriding backing file ===

tests/qemu-iotests/051.out +0 -0
@@ -60,7 +59,7 @@ QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could 

not be initialized
Testing: -drive
file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig
-nodefaults
QEMU X.Y.Z monitor - type 'help' for more information
(qemu)
iininfinfoinfo info binfo blinfo bloinfo blocinfo block

tests/qemu-iotests/051.out +1 -1
-ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
+virtio0: TEST_DIR/t.qcow2 (qcow2)
      Cache mode:       writeback
      Backing file:     TEST_DIR/t.qcow2.orig (chain depth: 1)
  (qemu) qququiquit
@@ -110,79 +109,56 @@ QEMU X.Y.Z monitor - type 'help' for more 

information
Testing: -drive if=floppy
QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +6 -5
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive if=ide,media=cdrom
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive if=scsi,media=cdrom
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive if=ide
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Device needs media, but drive is empty
-QEMU_PROG: Initialization of device ide-hd failed: Device 

initialization failed.

tests/qemu-iotests/051.out +2 -0
+(qemu)
+qququiquit
    Testing: -drive if=virtio
  QEMU X.Y.Z monitor - type 'help' for more information
  (qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive 

is empty
-QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized
+QEMU_PROG: -drive if=virtio: Device 'virtio-blk-s390' could not be initialized
Testing: -drive if=scsi
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device needs media, but drive is empty

tests/qemu-iotests/051.out +0 -6
-
-Testing: -drive if=none,id=disk -device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051.out +0 -6
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive if=none,id=disk -device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, 

but drive is empty

tests/qemu-iotests/051.out +0 -2
-QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could 

not be initialized

tests/qemu-iotests/051.out +0 -4
-
-Testing: -drive if=none,id=disk -device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but 

drive is empty

tests/qemu-iotests/051.out +0 -2
-QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be 

initialized

tests/qemu-iotests/051.out +0 -2
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk

tests/qemu-iotests/051.out +0 -2
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, 

but drive is empty
-QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized

tests/qemu-iotests/051.out +0 -2
-
-Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-hd,drive=disk

tests/qemu-iotests/051.out +0 -2
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, 

but drive is empty
-QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized

tests/qemu-iotests/051.out +6 -2
+(qemu)
+qququiquit
      === Read-only ===
    Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive 

file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +2 -3
-(qemu) qququiquit
+(qemu)
+qququiquit
    Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: Can't use a read-only drive
-QEMU_PROG: Initialization of device ide-hd failed: Device 

initialization failed.

tests/qemu-iotests/051.out +2 -0
+(qemu)
+qququiquit
    Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
  QEMU X.Y.Z monitor - type 'help' for more information
@@ -190,61 +166,39 @@ QEMU X.Y.Z monitor - type 'help' for more 

information
Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +0 -16
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-cd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-drive,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a 

read-only drive

tests/qemu-iotests/051.out +0 -2
-QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could 

not be initialized

tests/qemu-iotests/051.out +0 -5
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only 

drive

tests/qemu-iotests/051.out +0 -2
-QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
-QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be 

initialized

tests/qemu-iotests/051.out +19 -16
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-disk,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
-
-Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-hd,drive=disk
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
      === Cache modes ===
  -Testing: -drive media=cdrom,cache=none
+Testing: -drive if=scsi,media=cdrom,cache=none
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
  -Testing: -drive media=cdrom,cache=directsync
+Testing: -drive if=scsi,media=cdrom,cache=directsync
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
  -Testing: -drive media=cdrom,cache=writeback
+Testing: -drive if=scsi,media=cdrom,cache=writeback
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
  -Testing: -drive media=cdrom,cache=writethrough
+Testing: -drive if=scsi,media=cdrom,cache=writethrough
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
  -Testing: -drive media=cdrom,cache=unsafe
+Testing: -drive if=scsi,media=cdrom,cache=unsafe
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qququiquit
+(qemu)
+qququiquit
  -Testing: -drive media=cdrom,cache=invalid_value
-QEMU_PROG: -drive media=cdrom,cache=invalid_value: invalid cache option
+Testing: -drive if=scsi,media=cdrom,cache=invalid_value
+QEMU_PROG: -drive if=scsi,media=cdrom,cache=invalid_value: invalid 

cache option

      === Specifying the protocol layer ===
tests/qemu-iotests/051.out +0 -1
@@ -355,56 +309,56 @@ wrote 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive
file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2

tests/qemu-iotests/051.out +0 -2
-snapshot
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit
Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit

tests/qemu-iotests/051.out +0 -1
@@ -413,7 +367,7 @@ read 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x2qemu-io virtio0 "write
-P
0x22qemu-io virtio0 "wr!
ite
-P
0x22 qemu-io virtio0 "write -P 0x22 0qemu-io virtio0 "write -P 0x22 0 qemu-io virtio0 "write -P 0x22 0 4qemu-io virtio0 "write -P 0x22 0 4kqemu-io virtio0 "write -P 0x22 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
(qemu) qququiquit

tests/qemu-iotests/051.out +0 -1
@@ -422,10 +376,10 @@ read 4096/4096 bytes at offset 0
  4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
  Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w!

rite
-P
0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k" +(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io
qemu-io vqemu-io viqemu-io virqemu-io virtqemu-io virtiqemu-io virtioqemu-io virtio0qemu-io virtio0 qemu-io virtio0 "qemu-io virtio0 "wqemu-io virtio0 "wrqemu-io virtio0 "wriqemu-io virtio0 "writ!
qemu-io virtio0
"writeqemu-io virtio0 "write qemu-io virtio0 "write
-qemu-io
virtio0 "write
-Pqemu-io
virtio0 "write
-P
qemu-io virtio0 "write -P 0qemu-io virtio0 "write -P 0xqemu-io virtio0 "write -P 0x3qemu-io virtio0 "write
-P
0x33qemu-io virtio0 "wr!
ite
-P
0x33 qemu-io virtio0 "write -P 0x33 0qemu-io virtio0 "write -P 0x33 0 qemu-io virtio0 "write -P 0x33 0 4qemu-io virtio0 "write -P 0x33 0 4kqemu-io virtio0 "write -P 0x33 0 4k"
wrote 4096/4096 bytes at offset 0
4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-(qemu)
ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu)
ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
(qemu) qququiquit

    read 4096/4096 bytes at offset 0
tests/qemu-iotests/051.pc.out new file +3 -0
new file mode 100644
index 0000000..4c9224d
@@ -0,0 +1,433 @@
+QA output created by 051
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 

backing_file='TEST_DIR/t.IMGFMT.base'

tests/qemu-iotests/051.pc.out new file +5 -0
+
+=== Unknown option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: 

Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: 

Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +6 -0
+
+
+=== Unknown protocol option ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=: Block protocol 'file' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=on: Block protocol 'file' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=1234: Block protocol 'file' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,file.unknown_opt=foo: Block protocol 'file' doesn't support the option 'unknown_opt'

tests/qemu-iotests/051.pc.out new file +6 -0
+
+
+=== Invalid format ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=foo: Unknown driver 

'foo'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: Unknown driver 

'foo'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,format=qcow2: 

Cannot specify both 'driver' and 'format'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: 

Cannot specify both 'driver' and 'format'

tests/qemu-iotests/051.pc.out new file +13 -0
+
+
+=== Device without drive ===
+
+Testing: -device virtio-scsi-pci -device scsi-hd
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd: drive property not set
+QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
+
+
+=== Overriding backing file ===
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig

tests/qemu-iotests/051.pc.out new file +2 -1
-nodefaults
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) 

iininfinfoinfo info binfo blinfo bloinfo blocinfo block

tests/qemu-iotests/051.pc.out new file +6 -0
+ide0-hd0: TEST_DIR/t.qcow2 (qcow2)
+    Cache mode:       writeback
+    Backing file:     TEST_DIR/t.qcow2.orig (chain depth: 1)
+(qemu) qququiquit
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=raw,backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=file,file.backing.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.backing.driver=qcow2,file.backing.file.filename=TEST_DIR/t.qcow2.orig: Driver doesn't support backing files

tests/qemu-iotests/051.pc.out new file +3 -0
+
+
+=== Enable and disable lazy refcounting on the command line, plus 

some invalid values ===

tests/qemu-iotests/051.pc.out new file +11 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=: Parameter 'lazy-refcounts' expects 'on' or 'off'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=42: Parameter 'lazy-refcounts' expects 'on' or 'off'

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=foo: Parameter 'lazy-refcounts' expects 'on' or 'off'

tests/qemu-iotests/051.pc.out new file +7 -0
+
+
+=== With version 2 images enabling lazy refcounts must fail ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on
+QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=on: Lazy refcounts require a qcow2 image with at least qemu 1.1 compatibility level

tests/qemu-iotests/051.pc.out new file +24 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,lazy-refcounts=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+
+=== No medium ===
+
+Testing: -drive if=floppy
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=ide,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=ide
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Device needs media, but drive is empty
+QEMU_PROG: Initialization of device ide-hd failed: Device 

initialization failed.

tests/qemu-iotests/051.pc.out new file +4 -0
+
+Testing: -drive if=virtio
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -drive if=virtio: Device needs media, but drive is 

empty
+QEMU_PROG: -drive if=virtio: Device 'virtio-blk-pci' could not be initialized

tests/qemu-iotests/051.pc.out new file +4 -0
+
+Testing: -drive if=scsi
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device 

needs media, but drive is empty

tests/qemu-iotests/051.pc.out new file +6 -0
+
+Testing: -drive if=none,id=disk -device ide-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051.pc.out new file +6 -0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=none,id=disk -device ide-drive,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Device needs media, 

but drive is empty

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could 

not be initialized

tests/qemu-iotests/051.pc.out new file +4 -0
+
+Testing: -drive if=none,id=disk -device ide-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Device needs media, but 

drive is empty

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be 

initialized

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-disk,drive=disk: Device needs media, 

but drive is empty
+QEMU_PROG: -device scsi-disk,drive=disk: Device 'scsi-disk' could not be initialized

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive if=none,id=disk -device lsi53c895a -device 

scsi-hd,drive=disk

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device scsi-hd,drive=disk: Device needs media, 

but drive is empty
+QEMU_PROG: -device scsi-hd,drive=disk: Device 'scsi-hd' could not be initialized

tests/qemu-iotests/051.pc.out new file +20 -0
+
+
+=== Read-only ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=floppy,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=ide,media=cdrom,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,media=cdrom,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: Can't use a read-only drive
+QEMU_PROG: Initialization of device ide-hd failed: Device 

initialization failed.

tests/qemu-iotests/051.pc.out new file +20 -3
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=virtio,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=scsi,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-cd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-drive,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-drive,drive=disk: Can't use a 

read-only drive

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could 

not be initialized

tests/qemu-iotests/051.pc.out new file +4 -1
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device ide-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) QEMU_PROG: -device ide-hd,drive=disk: Can't use a read-only 

drive

tests/qemu-iotests/051.pc.out new file +2 -0
+QEMU_PROG: -device ide-hd,drive=disk: Device initialization failed.
+QEMU_PROG: -device ide-hd,drive=disk: Device 'ide-hd' could not be 

initialized

tests/qemu-iotests/051.pc.out new file +34 -2
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-disk,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-hd,drive=disk
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+
+=== Cache modes ===
+
+Testing: -drive if=scsi,media=cdrom,cache=none
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=directsync
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writeback
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writethrough
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=unsafe
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=invalid_value
+QEMU_PROG: -drive if=scsi,media=cdrom,cache=invalid_value: invalid 

cache option

tests/qemu-iotests/051.pc.out new file +10 -0
+
+
+=== Specifying the protocol layer ===
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.driver=file
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,file.driver=qcow2: Block 

format 'qcow2' used by device '' doesn't support the option 'filename'

tests/qemu-iotests/051.pc.out new file +6 -0
+
+
+=== Leaving out required options ===
+
+Testing: -drive driver=file
+QEMU_PROG: -drive driver=file: The 'file' block driver requires a 

file name

tests/qemu-iotests/051.pc.out new file +6 -0
+
+Testing: -drive driver=nbd
+QEMU_PROG: -drive driver=nbd: one of path and host must be specified.
+
+Testing: -drive driver=raw
+QEMU_PROG: -drive driver=raw: Can't use 'raw' as a block driver for 

the protocol level

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file.driver=file
+QEMU_PROG: -drive file.driver=file: The 'file' block driver requires 

a file name

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file.driver=nbd
+QEMU_PROG: -drive file.driver=nbd: one of path and host must be 

specified.

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file.driver=raw
+QEMU_PROG: -drive file.driver=raw: Can't use 'raw' as a block driver 

for the protocol level

tests/qemu-iotests/051.pc.out new file +8 -0
+
+Testing: -drive foo=bar
+QEMU_PROG: -drive foo=bar: Must specify either driver or file
+
+
+=== Specifying both an option and its legacy alias ===
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops=1234,throttling.iops-total=5678: 'throttling.iops-total' and its alias 'iops' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_rd=1234,throttling.iops-read=5678: 'throttling.iops-read' and its alias 'iops_rd' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_wr=1234,throttling.iops-write=5678: 'throttling.iops-write' and its alias 'iops_wr' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps=1234,throttling.bps-total=5678: 'throttling.bps-total' and its alias 'bps' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps_rd=1234,throttling.bps-read=5678: 'throttling.bps-read' and its alias 'bps_rd' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps_wr=1234,throttling.bps-write=5678: 'throttling.bps-write' and its alias 'bps_wr' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_max=1234,throttling.iops-total-max=5678: 'throttling.iops-total-max' and its alias 'iops_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_rd_max=1234,throttling.iops-read-max=5678: 'throttling.iops-read-max' and its alias 'iops_rd_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_wr_max=1234,throttling.iops-write-max=5678: 'throttling.iops-write-max' and its alias 'iops_wr_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps_max=1234,throttling.bps-total-max=5678: 'throttling.bps-total-max' and its alias 'bps_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps_rd_max=1234,throttling.bps-read-max=5678: 'throttling.bps-read-max' and its alias 'bps_rd_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,bps_wr_max=1234,throttling.bps-write-max=5678: 'throttling.bps-write-max' and its alias 'bps_wr_max' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +2 -0
+
+Testing: -drive 

file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678
+QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,iops_size=1234,throttling.iops-size=5678: 'throttling.iops-size' and its alias 'iops_size' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +3 -0
+
+Testing: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,readonly=on,read-only=off: 

'read-only' and its alias 'readonly' can't be used at the same time

tests/qemu-iotests/051.pc.out new file +12 -0
+
+
+=== Parsing protocol from file name ===
+
+Testing: -hda foo:bar
+QEMU_PROG: -hda foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file=foo:bar
+QEMU_PROG: -drive file=foo:bar: Unknown protocol 'foo'
+
+Testing: -drive file.filename=foo:bar
+QEMU_PROG: -drive file.filename=foo:bar: Could not open 'foo:bar': 

No such file or directory

tests/qemu-iotests/051.pc.out new file +11 -0
+
+Testing: -hda file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qququiquit
+
+Testing: -drive file.filename=file:TEST_DIR/t.qcow2
+QEMU_PROG: -drive file.filename=file:TEST_DIR/t.qcow2: Could not 

open 'file:TEST_DIR/t.qcow2': No such file or directory

tests/qemu-iotests/051.pc.out new file +9 -0
+
+
+=== Snapshot mode ===
+
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file.filename=TEST_DIR/t.qcow2,driver=qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=file:TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2 -snapshot
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +7 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +9 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=off
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x2qemu-io ide0-hd0 "w!

rite
-P
0x22qemu-io ide0-hd0 "write -P 0x22 qemu-io ide0-hd0 "write -P 0x22 0qemu-io ide0-hd0 "write -P 0x22 0 qemu-io ide0-hd0 "write -P 0x22 0 4qemu-io ide0-hd0 "write -P 0x22 0 4kqemu-io ide0-hd0 "write -P 0x22 0 4k"

tests/qemu-iotests/051.pc.out new file +9 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Testing: -drive file=TEST_DIR/t.qcow2,snapshot=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) qqeqemqemuqemu-qemu-iqemu-ioqemu-io 

qemu-io iqemu-io idqemu-io ideqemu-io ide0qemu-io ide0-qemu-io ide0-hqemu-io ide0-hdqemu-io ide0-hd0qemu-io ide0-hd0 qemu-io ide0-hd0 "qemu-io ide0-hd0 "wqemu-io ide0-hd0 "wrqemu-io ide0-hd0 "wri!
qemu-io
ide0-hd0 "writqemu-io ide0-hd0 "writeqemu-io ide0-hd0 "write qemu-io ide0-hd0 "write
-qemu-io
ide0-hd0 "write
-Pqemu-io
ide0-hd0 "write -P qemu-io ide0-hd0 "write -P 0qemu-io ide0-hd0 "write -P 0xqemu-io ide0-hd0 "write -P 0x3qemu-io ide0-hd0 "w!

rite
-P
0x33qemu-io ide0-hd0 "write -P 0x33 qemu-io ide0-hd0 "write -P 0x33 0qemu-io ide0-hd0 "write -P 0x33 0 qemu-io ide0-hd0 "write -P 0x33 0 4qemu-io ide0-hd0 "write -P 0x33 0 4kqemu-io ide0-hd0 "write -P 0x33 0 4k"

tests/qemu-iotests/051.pc.out new file +3 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+(qemu) 

ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0

tests/qemu-iotests/051.pc.out new file +5 -0
+(qemu) qququiquit
+
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
tests/qemu-iotests/common.filter +6 -0
index 012a812..db86fd7 100644
@@ -154,9 +154,16 @@ _filter_qemu_io()
          -e "s/qemu-io> //g"
  }
  +# removes orphan warnings
+_filter_orphan()
+{
+    sed -e 's/ Warning: Orphaned drive without device:.*$//g'
+}
+
  # replace occurrences of QEMU_PROG with "qemu"
  _filter_qemu()
  {
+    _filter_orphan | \
      sed -e "s#\\(^\\|(qemu) \\)$(basename 
 $QEMU_PROG):#\1QEMU_PROG:#" \
          -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z 
monitor#' \
          -e '/main-loop: WARNING: I\/O thread spun for [0-9]\+ 

iterations/d' \

#11 lore raw

Re: [Qemu-devel] [PATCH RFC v7 6/7] qemu-iotests: s390x: fix test 051

Hi Tu Bo :-)

Quoted 213 lines · tu bo

Hi Max:

Quoted 210 lines · Max Reitz
Quoted 205 lines · Xiao Guang Chen

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.
A new filter was added to filter orphan warnings.

---
  tests/qemu-iotests/051           |  79 ++++---
  tests/qemu-iotests/051.out       | 156 +++++---------
  tests/qemu-iotests/051.pc.out    | 433 
+++++++++++++++++++++++++++++++++++++++
  tests/qemu-iotests/common.filter |   7 +
  4 files changed, 545 insertions(+), 130 deletions(-)

create mode 100644 tests/qemu-iotests/051.pc.out

tests/qemu-iotests/051 +0 -1
index 0360f37..8de16a5 100755
@@ -147,13 +147,19 @@ run_qemu -drive if=ide
  run_qemu -drive if=virtio
  run_qemu -drive if=scsi
  -run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051 +0 -4
-
-run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
-run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk
-run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk

tests/qemu-iotests/051 +4 -0
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive if=none,id=disk -device ide-cd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-cd,drive=disk

tests/qemu-iotests/051 +4 -0
+
+        run_qemu -drive if=none,id=disk -device ide-drive,drive=disk
+        run_qemu -drive if=none,id=disk -device ide-hd,drive=disk
+        run_qemu -drive if=none,id=disk -device lsi53c895a -device 

scsi-disk,drive=disk
+ run_qemu -drive if=none,id=disk -device lsi53c895a -device
scsi-hd,drive=disk

tests/qemu-iotests/051 +4 -0
+        ;;
+    *)
+        ;;
+esac
    echo
  echo === Read-only ===
@@ -167,13 +173,19 @@ run_qemu -drive 

file="$TEST_IMG",if=ide,readonly=on
run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on -run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on

tests/qemu-iotests/051 +3 -3
-device ide-cd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-cd,drive=disk
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        run_qemu -drive 

file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
+ run_qemu -drive
file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a

tests/qemu-iotests/051 +1 -8
-device scsi-cd,drive=disk
  -run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-drive,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device ide-hd,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-disk,drive=disk
-run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on 
-device lsi53c895a -device scsi-hd,drive=disk
+        run_qemu -drive 

file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
+ run_qemu -drive
file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
+ run_qemu -drive
file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a

tests/qemu-iotests/051 +1 -1
-device scsi-disk,drive=disk
+        run_qemu -drive 

file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a

tests/qemu-iotests/051 +4 -1
-device scsi-hd,drive=disk
+        ;;
+    *)
+        ;;
+esac
    echo
  echo === Cache modes ===
@@ -182,12 +194,12 @@ echo
  # Cannot use the test image because cache=none might not work on 

the host FS
# Use cdrom so that we won't get errors about missing media -run_qemu -drive media=cdrom,cache=none

tests/qemu-iotests/051 +14 -5
-run_qemu -drive media=cdrom,cache=directsync
-run_qemu -drive media=cdrom,cache=writeback
-run_qemu -drive media=cdrom,cache=writethrough
-run_qemu -drive media=cdrom,cache=unsafe
-run_qemu -drive media=cdrom,cache=invalid_value
+run_qemu -drive if=scsi,media=cdrom,cache=none
+run_qemu -drive if=scsi,media=cdrom,cache=directsync
+run_qemu -drive if=scsi,media=cdrom,cache=writeback
+run_qemu -drive if=scsi,media=cdrom,cache=writethrough
+run_qemu -drive if=scsi,media=cdrom,cache=unsafe
+run_qemu -drive if=scsi,media=cdrom,cache=invalid_value
    echo
  echo === Specifying the protocol layer ===
@@ -251,28 +263,37 @@ echo
  echo === Snapshot mode ===
  echo
  +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;
+esac
+
  $QEMU_IO -c "write -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io
  -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive 

file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io -echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2,snapshot=on | _filter_qemu_io +echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file.filename="$TEST_IMG",driver=qcow2 -snapshot | _filter_qemu_io +echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="file:$TEST_IMG",snapshot=on | _filter_qemu_io
# Opening a read-only file r/w with snapshot=on
chmod u-w "$TEST_IMG"
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG" -snapshot | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io
chmod u+w "$TEST_IMG"

    $QEMU_IO -c "read -P 0x11 0 4k" "$TEST_IMG" | _filter_qemu_io

-echo 'qemu-io ide0-hd0 "write -P 0x22 0 4k"' | run_qemu -drive
file="$TEST_IMG",snapshot=off | _filter_qemu_io
+echo "qemu-io $device_id \"write -P 0x22 0 4k\"" | run_qemu -drive file="$TEST_IMG",snapshot=off | _filter_qemu_io

    $QEMU_IO -c "read -P 0x22 0 4k" "$TEST_IMG" | _filter_qemu_io

-echo -e 'qemu-io ide0-hd0 "write -P 0x33 0 4k"\ncommit ide0-hd0'
| run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io +echo -e "qemu-io $device_id \"write -P 0x33 0 4k\"\ncommit $device_id" | run_qemu -drive file="$TEST_IMG",snapshot=on | _filter_qemu_io

    $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io

diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 2890eac..63e0e81 100644

tests/qemu-iotests/051.out +0 -0
@@ -5,16 +5,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT 

size=134217728 backing_file='TEST_DIR
=== Unknown option ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=:
Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=:
Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
-QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'

    Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234

-QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
-QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'ide0-hd0' doesn't support the option 'unknown_opt' +QEMU_PROG: -drive
file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block format 'qcow2' used by device 'virtio0' doesn't support the option 'unknown_opt'

      === Unknown protocol option ===
tests/qemu-iotests/051.out +0 -0
@@ -51,8 +51,7 @@ QEMU_PROG: -drive 

file=TEST_DIR/t.qcow2,driver=qcow2,format=qcow2: Cannot specif
Testing: -device virtio-scsi-pci -device scsi-hd
QEMU X.Y.Z monitor - type 'help' for more information

tests/qemu-iotests/051.out +1 -2
-(qemu) QEMU_PROG: -device scsi-hd: drive property not set
-QEMU_PROG: -device scsi-hd: Device 'scsi-hd' could not be initialized
+(qemu) QEMU_PROG: -device virtio-scsi-pci: No 'PCI' bus found for 
Quoted 1 line

device 'virtio-scsi-pci'

This change looks like you'd rather just disable this test for non-PCI systems. Also, it's a change from v6 which forces me to remind you to please remove Reviewed-by statements from the commit message if there are functional changes in a patch from the previously reviewed version.

Quoted 4 lines
Quoted 3 lines

(Because just like in this case, the reviewer (i.e., me) may find some of these changes questionable, or might even outright object them.)

Max

1. Sure. will remove Reviewed-by statements if any functional changes in a new patch version. thanks for the reminder

Thank you :-)

Quoted 3 lines

2. Test 051 will be executed for PCI systems like x86, and test 051 will be executed for non-PCI systems like s390x as well. However, its golden test data is different(051.out is for s390x, 051.pc.out is for x86) Test steps are different between PCI systems and non-PCI systems.
For instance, the tests for device type "ide_cd" should only be tested for the pc platform, and be disabled for non-PCI systems.

Right. So I think the same is the case here: A PCI device (virtio-scsi-pci) is created by the test, so it should be disabled for non-PCI systems. While testing against the reference output "No 'PCI' bus found" will probably not break on non-PCI systems, it doesn't seem like it's something we want to test here, though.

Max

#12 lore raw

RFC PATCH v7 7/7 qemu-iotests-s390x-fix-test-130

In reply to Xiao Guang Chen

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.

---
 tests/qemu-iotests/130        | 13 +++++++++++--
 tests/qemu-iotests/130.out    |  4 ++--
 tests/qemu-iotests/130.pc.out | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 4 deletions(-)
 create mode 100644 tests/qemu-iotests/130.pc.out
tests/qemu-iotests/130 +11 -2
index bc26247..de40c7b 100755
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
 echo
 # bdrv_make_empty() involves a header update for qcow2
 
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;
+esac
+
 # Test that a backing file isn't written
 _launch_qemu -drive file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"
 _send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
 _cleanup_qemu
 _img_info | _filter_img_info
@@ -69,7 +78,7 @@ _img_info | _filter_img_info
 # command line, that backing file is retained, with the right format
 _make_test_img -F raw -b "$TEST_IMG.orig" 64M
 _launch_qemu -drive file="$TEST_IMG",backing.file.filename="$TEST_IMG.base",backing.driver=$IMGFMT
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"
 _send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
 _cleanup_qemu
 _img_info | _filter_img_info
tests/qemu-iotests/130.out +2 -2
index ea68b5d..cc4a15a 100644
@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes)
 === HMP commit ===
 
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
 (qemu) 
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
 virtual size: 64M (67108864 bytes)
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'
 QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
 (qemu) 
 image: TEST_DIR/t.IMGFMT
 file format: IMGFMT
tests/qemu-iotests/130.pc.out new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
2.3.0
Reviewed-by on v7 7/7
#13 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

Quoted 21 lines · Xiao Guang Chen

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.

---
  tests/qemu-iotests/130        | 13 +++++++++++--
  tests/qemu-iotests/130.out    |  4 ++--
  tests/qemu-iotests/130.pc.out | 43 +++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 56 insertions(+), 4 deletions(-)

create mode 100644 tests/qemu-iotests/130.pc.out

tests/qemu-iotests/130 +0 -0
index bc26247..de40c7b 100755

tests/qemu-iotests/130 echo "=== HMP commit ===" · line 67

Quoted 10 lines
tests/qemu-iotests/130 +7 -0
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
  echo
  # bdrv_make_empty() involves a header update for qcow2
 
+case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

tests/qemu-iotests/130 echo "=== HMP commit ===" · line 72

Quoted 6 lines
tests/qemu-iotests/130 +3 -1
+esac
+
  # Test that a backing file isn't written
  _launch_qemu -drive file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"

("commit $device_id" "(qemu)" would've worked, too, but it's fine the way _send_qemu_cmd works)

Quoted 82 lines
tests/qemu-iotests/130 +1 -1
  _send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
  _cleanup_qemu
  _img_info | _filter_img_info
@@ -69,7 +78,7 @@ _img_info | _filter_img_info
  # command line, that backing file is retained, with the right format
  _make_test_img -F raw -b "$TEST_IMG.orig" 64M
  _launch_qemu -drive file="$TEST_IMG",backing.file.filename="$TEST_IMG.base",backing.driver=$IMGFMT
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"
  _send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
  _cleanup_qemu
  _img_info | _filter_img_info
tests/qemu-iotests/130.out +2 -2
index ea68b5d..cc4a15a 100644
@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes)
  === HMP commit ===
 
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
  (qemu)
  image: TEST_DIR/t.IMGFMT
  file format: IMGFMT
  virtual size: 64M (67108864 bytes)
  Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'
  QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu) ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
  (qemu)
  image: TEST_DIR/t.IMGFMT
  file format: IMGFMT
tests/qemu-iotests/130.pc.out new file +43 -0
new file mode 100644
index 0000000..ea68b5d
@@ -0,0 +1,43 @@
+QA output created by 130
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+
+=== HMP commit ===
+
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0
+(qemu)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+backing file: TEST_DIR/t.IMGFMT.orig
+backing file format: raw
+
+=== Marking image dirty (lazy refcounts) ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+backing file: TEST_DIR/t.IMGFMT.orig
+backing file format: raw
+*** done
#14 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Hi Max:

Quoted 3 lines · Max Reitz

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

Quoted 36 lines · Xiao Guang Chen
Quoted 22 lines

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.

---
  tests/qemu-iotests/130        | 13 +++++++++++--
  tests/qemu-iotests/130.out    |  4 ++--
  tests/qemu-iotests/130.pc.out | 43 
+++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 56 insertions(+), 4 deletions(-)

create mode 100644 tests/qemu-iotests/130.pc.out

tests/qemu-iotests/130 +0 -0
index bc26247..de40c7b 100755

tests/qemu-iotests/130 echo "=== HMP commit ===" · line 66

Quoted 9 lines
tests/qemu-iotests/130 +6 -0
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
  echo
  # bdrv_make_empty() involves a header update for qcow2
  +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Quoted 5 lines

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051", because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:
/v5://
//1. Add a pc specific output file for test 051.//
//2. Add a filter to test case 051 to filter s390 specific warnings.//
//3. Check whether the machine type is pc or not rather than check whether the machine type //
//is s390.//
//4. When using a machine specific reference file if the default machine has an alias then//
//use the alias as the output file name otherwise use the default machine name as the output//
//file name/

Quoted 104 lines

tests/qemu-iotests/130

Quoted 8 lines
tests/qemu-iotests/130 +2 -0
+esac
+
  # Test that a backing file isn't written
  _launch_qemu -drive 

file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"

tests/qemu-iotests/130 +1 -1
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"

("commit $device_id" "(qemu)" would've worked, too, but it's fine the way _send_qemu_cmd works)

Quoted 91 lines

_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
_cleanup_qemu
_img_info | _filter_img_info

tests/qemu-iotests/130 +0 -0
@@ -69,7 +78,7 @@ _img_info | _filter_img_info
  # command line, that backing file is retained, with the right format
  _make_test_img -F raw -b "$TEST_IMG.orig" 64M
  _launch_qemu -drive 

file="$TEST_IMG",backing.file.filename="$TEST_IMG.base",backing.driver=$IMGFMT

tests/qemu-iotests/130 +1 -1
-_send_qemu_cmd $QEMU_HANDLE "commit ide0-hd0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit " $device_id "(qemu)"
  _send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
  _cleanup_qemu
  _img_info | _filter_img_info
tests/qemu-iotests/130.out +0 -1
index ea68b5d..cc4a15a 100644
@@ -9,14 +9,14 @@ virtual size: 64M (67108864 bytes)
  === HMP commit ===
    QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) 

ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0 +(qemu)
ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
(qemu)
image: TEST_DIR/t.IMGFMT
file format: IMGFMT
virtual size: 64M (67108864 bytes)
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'
QEMU X.Y.Z monitor - type 'help' for more information
-(qemu)
ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0 +(qemu)
ccocomcommcommicommitcommit commit vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
(qemu)
image: TEST_DIR/t.IMGFMT
file format: IMGFMT

tests/qemu-iotests/130.pc.out new file +12 -0
new file mode 100644
index 0000000..ea68b5d
@@ -0,0 +1,43 @@
+QA output created by 130
+Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+
+=== HMP commit ===
+
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) 

ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0

tests/qemu-iotests/130.pc.out new file +5 -0
+(qemu)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 

backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'

tests/qemu-iotests/130.pc.out new file +2 -0
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) 

ccocomcommcommicommitcommit commit icommit idcommit idecommit ide0commit ide0-commit ide0-hcommit ide0-hdcommit ide0-hd0

tests/qemu-iotests/130.pc.out new file +16 -0
+(qemu)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+backing file: TEST_DIR/t.IMGFMT.orig
+backing file format: raw
+
+=== Marking image dirty (lazy refcounts) ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 

backing_file='TEST_DIR/t.IMGFMT.orig' backing_fmt='raw'

tests/qemu-iotests/130.pc.out new file +8 -0
+wrote 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+backing file: TEST_DIR/t.IMGFMT.orig
+backing file format: raw
+*** done
#15 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Quoted 43 lines · tu bo

Hi Max:

Quoted 3 lines · Max Reitz

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

Quoted 36 lines · Xiao Guang Chen
Quoted 22 lines

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.

---
  tests/qemu-iotests/130        | 13 +++++++++++--
  tests/qemu-iotests/130.out    |  4 ++--
  tests/qemu-iotests/130.pc.out | 43 
+++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 56 insertions(+), 4 deletions(-)

create mode 100644 tests/qemu-iotests/130.pc.out

tests/qemu-iotests/130 +0 -0
index bc26247..de40c7b 100755

tests/qemu-iotests/130 echo "=== HMP commit ===" · line 66

Quoted 9 lines
tests/qemu-iotests/130 +6 -0
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
  echo
  # bdrv_make_empty() involves a header update for qcow2
  +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Quoted 6 lines
Quoted 5 lines

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051", because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:

Indeed we discussed it. Just for clarification, I disliked having only cases for "pc" and "s390" -- there are other platforms, too, which will simply break by not including them in these case statements. We could try to avoid this by defaulting to virtio0 for every non-pc platform, and it will probably work for most without having to do further work here.

However, I did accept it because all those non-PC (and non-s390) platforms won't pass the tests before this patch set either (because these test cases try to use IDE devices which will not be available there). So the series will not break them because they didn't work before either.

Bottom line: I'm fine with this solution as it is.

Max

Quoted 8 lines

/v5://
//1. Add a pc specific output file for test 051.//
//2. Add a filter to test case 051 to filter s390 specific warnings.//
//3. Check whether the machine type is pc or not rather than check whether the machine type // //is s390.//
//4. When using a machine specific reference file if the default machine has an alias then// //use the alias as the output file name otherwise use the default machine name as the output// //file name/

#16 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Am 27.04.2015 um 13:24 hat Max Reitz geschrieben:

Quoted 77 lines · tu bo

Hi Max:

On 04/24/2015 01:07 AM, Max Reitz wrote:

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

On 23.04.2015 04:42, Xiao Guang Chen wrote:

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform.
The default device id of hard disk on the s390 platform differs to that
of the x86 platform. A new variable device_id is defined and "virtio0"
set for the s390 platform. A x86 platform specific output file is also
needed.

---
  tests/qemu-iotests/130        | 13 +++++++++++-- tests/qemu-iotests/130.out    |  4 ++-- tests/qemu-iotests/130.pc.out | 43
+++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/qemu-iotests/130.pc.out

diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index bc26247..de40c7b 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -58,9 +58,18 @@ echo "=== HMP commit ===" echo
  # bdrv_make_empty() involves a header update for qcow2 +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051",  because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:

Indeed we discussed it. Just for clarification, I disliked having only cases for "pc" and "s390" -- there are other platforms, too, which will simply break by not including them in these case statements. We could try to avoid this by defaulting to virtio0 for every non-pc platform, and it will probably work for most without having to do further work here.

Quoted 6 lines

However, I did accept it because all those non-PC (and non-s390) platforms won't pass the tests before this patch set either (because these test cases try to use IDE devices which will not be available there). So the series will not break them because they didn't work before either.

Bottom line: I'm fine with this solution as it is.

Maybe I'm missing the obvious, but why don't you just specify an explicit ID instead of guessing the default ID that qemu will use depending on the platform?

Kevin

#17 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Hi Kevin:

Quoted 83 lines · Kevin Wolf

Am 27.04.2015 um 13:24 hat Max Reitz geschrieben:

Quoted 82 lines · tu bo

Hi Max:

On 04/24/2015 01:07 AM, Max Reitz wrote:

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

On 23.04.2015 04:42, Xiao Guang Chen wrote:

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform.
The default device id of hard disk on the s390 platform differs to that
of the x86 platform. A new variable device_id is defined and "virtio0"
set for the s390 platform. A x86 platform specific output file is also
needed.

---
tests/qemu-iotests/130 | 13 +++++++++++--
tests/qemu-iotests/130.out | 4 ++--
tests/qemu-iotests/130.pc.out | 43
+++++++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/qemu-iotests/130.pc.out

diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index bc26247..de40c7b 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
echo
# bdrv_make_empty() involves a header update for qcow2 +case "$QEMU_DEFAULT_MACHINE" in
+ pc)
+ device_id="ide0-hd0"
+ ;;
+ s390)
+ device_id="virtio0"
+ ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051", because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:

Indeed we discussed it. Just for clarification, I disliked having only cases for "pc" and "s390" -- there are other platforms, too, which will simply break by not including them in these case statements. We could try to avoid this by defaulting to virtio0 for every non-pc platform, and it will probably work for most without having to do further work here.

However, I did accept it because all those non-PC (and non-s390) platforms won't pass the tests before this patch set either (because these test cases try to use IDE devices which will not be available there). So the series will not break them because they didn't work before either.

Quoted 4 lines
Quoted 1 line

Bottom line: I'm fine with this solution as it is.

Maybe I'm missing the obvious, but why don't you just specify an explicit ID instead of guessing the default ID that qemu will use depending on the platform?

Please forgive me that I'm very sure about the meaning of "default ID" you mentioned. Maybe you mean "default device ID"? If I'm wrong, please correct me :-)

The default device id of hard disk on the s390 platform differs to the device id on the x86 platform, so we need to use different device id for different platform. For instance, using "virtio0" for s390x, and using "ide0-hd0" for x86 as below:
/+_send_qemu_cmd $QEMU_HANDLE "commit " *"virtio0"* "(qemu)"//
//+_send_qemu_cmd $QEMU_HANDLE "commit " *"ide0-hd0"* "(qemu)"/

Quoted 3 lines

Kevin

#18 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Am 28.04.2015 um 04:59 hat tu bo geschrieben:

Quoted 102 lines

Hi Kevin:

On 04/27/2015 07:34 PM, Kevin Wolf wrote:

Am 27.04.2015 um 13:24 hat Max Reitz geschrieben:

On 27.04.2015 09:15, tu bo wrote:

Hi Max:

On 04/24/2015 01:07 AM, Max Reitz wrote:

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

On 23.04.2015 04:42, Xiao Guang Chen wrote:

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform.
The default device id of hard disk on the s390 platform differs to that
of the x86 platform. A new variable device_id is defined and "virtio0"
set for the s390 platform. A x86 platform specific output file is also
needed.

---
  tests/qemu-iotests/130        | 13 +++++++++++-- tests/qemu-iotests/130.out    |  4 ++-- tests/qemu-iotests/130.pc.out | 43
+++++++++++++++++++++++++++++++++++++++++++
  3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/qemu-iotests/130.pc.out

diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index bc26247..de40c7b 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -58,9 +58,18 @@ echo "=== HMP commit ===" echo
  # bdrv_make_empty() involves a header update for qcow2 +case "$QEMU_DEFAULT_MACHINE" in
+    pc)
+        device_id="ide0-hd0"
+        ;;
+    s390)
+        device_id="virtio0"
+        ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051",  because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:

Indeed we discussed it. Just for clarification, I disliked having only cases for "pc" and "s390" -- there are other platforms, too, which will simply break by not including them in these case statements. We could try to avoid this by defaulting to virtio0 for every non-pc platform, and it will probably work for most without having to do further work here.

However, I did accept it because all those non-PC (and non-s390) platforms won't pass the tests before this patch set either (because these test cases try to use IDE devices which will not be available there). So the series will not break them because they didn't work before either.

Bottom line: I'm fine with this solution as it is.

Maybe I'm missing the obvious, but why don't you just specify an explicit ID instead of guessing the default ID that qemu will use depending on the platform?

Please forgive me that I'm very sure about the meaning of "default ID"  you mentioned. Maybe you mean "default device ID"? If I'm wrong, please correct me :-)

The default device id of hard disk on the s390 platform differs to the device id on the x86 platform,  so we need to use different device id for different platform. For instance,  using "virtio0" for s390x, and using "ide0-hd0" for x86 as below:

Review

Quoted 2 lines
(quoted diff) +2 -0
+_send_qemu_cmd $QEMU_HANDLE "commit "  "virtio0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit "  "ide0-hd0" "(qemu)"

Any why not use this?

qemu -drive id=testdisk,...
(qemu) commit testdisk

That would be the same on all platforms.

Kevin

#19 lore raw

Re: [Qemu-devel] [PATCH RFC v7 7/7] qemu-iotests-s390x-fix-test-130

Hi Kevin:

Quoted 107 lines · Kevin Wolf

Am 28.04.2015 um 04:59 hat tu bo geschrieben:

Quoted 102 lines

Hi Kevin:

On 04/27/2015 07:34 PM, Kevin Wolf wrote:

Am 27.04.2015 um 13:24 hat Max Reitz geschrieben:

On 27.04.2015 09:15, tu bo wrote:

Hi Max:

On 04/24/2015 01:07 AM, Max Reitz wrote:

Well, that's a peculiar commit title. :-)

I guess it's supposed to be "qemu-iotests: s390x: fix test 130"?

You're right. I will change it in the next version :-)

On 23.04.2015 04:42, Xiao Guang Chen wrote:

From: Bo Tu <[email protected]>

The tests for device type "ide_cd" should only be tested for the pc platform.
The default device id of hard disk on the s390 platform differs to that
of the x86 platform. A new variable device_id is defined and "virtio0"
set for the s390 platform. A x86 platform specific output file is also
needed.

---
tests/qemu-iotests/130 | 13 +++++++++++--
tests/qemu-iotests/130.out | 4 ++--
tests/qemu-iotests/130.pc.out | 43
+++++++++++++++++++++++++++++++++++++++++++
3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 tests/qemu-iotests/130.pc.out

diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 index bc26247..de40c7b 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -58,9 +58,18 @@ echo "=== HMP commit ==="
echo
# bdrv_make_empty() involves a header update for qcow2 +case "$QEMU_DEFAULT_MACHINE" in
+ pc)
+ device_id="ide0-hd0"
+ ;;
+ s390)
+ device_id="virtio0"
+ ;;

I think I mentioned before that I don't really like not taking the fact into account that there are other machine types, too. I'm still accepting it based on the fact that I think those machine types won't pass the tests right now anyway, so not caring for them in these case blocks won't break any tests, but it still feels like something we can avoid (like defaulting to virtio0 for any non-pc platform).

Anyway, because I seem to remember I accepted it before:

With the commit title fixed:

I guess you discussed with Xiao Guang Chen and accepted it in "[PATCH RFC v5 6/7] qemu-iotests s390x fix test-051", because test 130 and 051 are using the same fix solution, and test 051 was fixed in v5. Seeing section of v5 in cover letter as below:

Indeed we discussed it. Just for clarification, I disliked having only cases for "pc" and "s390" -- there are other platforms, too, which will simply break by not including them in these case statements. We could try to avoid this by defaulting to virtio0 for every non-pc platform, and it will probably work for most without having to do further work here.

However, I did accept it because all those non-PC (and non-s390) platforms won't pass the tests before this patch set either (because these test cases try to use IDE devices which will not be available there). So the series will not break them because they didn't work before either.

Bottom line: I'm fine with this solution as it is.

Maybe I'm missing the obvious, but why don't you just specify an explicit ID instead of guessing the default ID that qemu will use depending on the platform?

Please forgive me that I'm very sure about the meaning of "default ID" you mentioned. Maybe you mean "default device ID"? If I'm wrong, please correct me :-)

The default device id of hard disk on the s390 platform differs to the device id on the x86 platform, so we need to use different device id for different platform. For instance, using "virtio0" for s390x, and using "ide0-hd0" for x86 as below:

Review

Quoted 2 lines
(quoted diff) +2 -0
+_send_qemu_cmd $QEMU_HANDLE "commit "  "virtio0" "(qemu)"
+_send_qemu_cmd $QEMU_HANDLE "commit "  "ide0-hd0" "(qemu)"

Any why not use this?

Quoted 2 lines

qemu -drive id=testdisk,...
(qemu) commit testdisk

I tried and it works fine, which is a more easier solution for test 130. I'll use your solution in patch v8. thanks a lot

Quoted 5 lines

That would be the same on all platforms.

Kevin