diff mbox

[RFC,v4,5/6] qemu-iotests: s390x: fix test 051

Message ID 1423107872-3268-6-git-send-email-chenxg@linux.vnet.ibm.com
State New
Headers show

Commit Message

Xiao Guang Chen Feb. 5, 2015, 3:44 a.m. UTC
From: Mao Chuan Li <maochuan@linux.vnet.ibm.com>

The tests for device type "ide_cd" are skipped for the s390 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 s390 platform specific output file is also
needed.

Reviewed-by:   Michael Mueller <mimu@linux.vnet.ibm.com>
Signed-off-by: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
---
 tests/qemu-iotests/051                 |  91 +++++---
 tests/qemu-iotests/051.s390-virtio.out | 377 +++++++++++++++++++++++++++++++++
 2 files changed, 439 insertions(+), 29 deletions(-)
 create mode 100644 tests/qemu-iotests/051.s390-virtio.out

 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
+
+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 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 vcommit vicommit vircommit virtcommit virticommit virtiocommit virtio0
+(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

Comments

Max Reitz Feb. 5, 2015, 3:11 p.m. UTC | #1
On 2015-02-04 at 22:44, Xiao Guang Chen wrote:
> From: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
>
> The tests for device type "ide_cd" are skipped for the s390 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 s390 platform specific output file is also
> needed.
>
> Reviewed-by:   Michael Mueller <mimu@linux.vnet.ibm.com>
> Signed-off-by: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
> ---
>   tests/qemu-iotests/051                 |  91 +++++---
>   tests/qemu-iotests/051.s390-virtio.out | 377 +++++++++++++++++++++++++++++++++
>   2 files changed, 439 insertions(+), 29 deletions(-)
>   create mode 100644 tests/qemu-iotests/051.s390-virtio.out

First: This patch contains lines which are too long to be sent via email 
(they are broken up and thus the patch needs manual fixup by the 
reviewers). If you could specify a public repository where we could pull 
from, that may be helpful to the reviewers.

Second: I'm not sure whether s390-virtio should be the special case 
here. Maybe "pc" is the platform that is actually special because it 
contains a floppy drive, an IDE CD drive and so on. So while this patch 
is (nearly?) correct, it may make more sense to move 051.out to 
051.pc.out and modify the current 051.out to be what is 
051.s390-virtio.out in this patch.

In the same way, maybe all the conditionals in this series (not just 
this patch) which check whether the machine type is s390-virtio should 
maybe instead check whether the machine type is not pc.

However, the problem with the pc machine type is that 
QEMU_DEFAULT_MACHINE will be version-dependent (currently, it's 
pc-i440fx-2.3), so that would require a workaround.

[snip]

> diff --git a/tests/qemu-iotests/051.s390-virtio.out b/tests/qemu-iotests/051.s390-virtio.out
> new file mode 100644
> index 0000000..751670f
> --- /dev/null
> +++ b/tests/qemu-iotests/051.s390-virtio.out
> @@ -0,0 +1,377 @@
> +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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device 'virtio0' 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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: 'foo' invalid format
> +
> +Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
> +QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: Driver specified twice
> +
> +
> +=== 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
> +virtio0: TEST_DIR/t.qcow2 (qcow2)
> +    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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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) Warning: Orphaned drive without device: id=floppy0,file=,if=floppy,bus=0,unit=0
> +qququiquit

Can't we get rid of these warnings somehow? If nothing else works, 
filter them out?

[snip]

> +=== 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 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"

This is an example of a line that got split into multiple lines in the 
email. It's fixable by the reviewer, but that requires work. :-)

Max
Xiao Guang Chen Feb. 9, 2015, 8:06 a.m. UTC | #2
On 02/05/2015 11:11 PM, Max Reitz wrote:
> On 2015-02-04 at 22:44, Xiao Guang Chen wrote:
>> From: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
>>
>> The tests for device type "ide_cd" are skipped for the s390 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 s390 platform specific output file is also
>> needed.
>>
>> Reviewed-by:   Michael Mueller <mimu@linux.vnet.ibm.com>
>> Signed-off-by: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
>> ---
>>   tests/qemu-iotests/051                 |  91 +++++---
>>   tests/qemu-iotests/051.s390-virtio.out | 377 
>> +++++++++++++++++++++++++++++++++
>>   2 files changed, 439 insertions(+), 29 deletions(-)
>>   create mode 100644 tests/qemu-iotests/051.s390-virtio.out
>
> First: This patch contains lines which are too long to be sent via 
> email (they are broken up and thus the patch needs manual fixup by the 
> reviewers). If you could specify a public repository where we could 
> pull from, that may be helpful to the reviewers.
I can not find a public repository. Do you have other options?
Or I manually split the long lines into small ones only for review. But 
it will not work if you apply the patch.
>
> Second: I'm not sure whether s390-virtio should be the special case 
> here. Maybe "pc" is the platform that is actually special because it 
> contains a floppy drive, an IDE CD drive and so on. So while this 
> patch is (nearly?) correct, it may make more sense to move 051.out to 
> 051.pc.out and modify the current 051.out to be what is 
> 051.s390-virtio.out in this patch.
>
OK.
> In the same way, maybe all the conditionals in this series (not just 
> this patch) which check whether the machine type is s390-virtio should 
> maybe instead check whether the machine type is not pc.
OK.
>
> However, the problem with the pc machine type is that 
> QEMU_DEFAULT_MACHINE will be version-dependent (currently, it's 
> pc-i440fx-2.3), so that would require a workaround.
>
When we run the qemu-system-x86_64 -machine ? we will get the following 
output:
Supported machines are:
pc                   Standard PC (i440FX + PIIX, 1996) (alias of 
pc-i440fx-2.3)
pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996) (default)
pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
pc-i440fx-2.1        Standard PC (i440FX + PIIX, 1996)
......

We can get the default machine:pc-i440fx-2.3 and the alias of the 
default machine:pc.
If the default machine has an alias then we use the alias otherwise we 
use the default machine.

*qemu/tests/qemu-iotests/common.config:*
/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/

How about this change?


> [snip]
>
>> diff --git a/tests/qemu-iotests/051.s390-virtio.out 
>> b/tests/qemu-iotests/051.s390-virtio.out
>> new file mode 100644
>> index 0000000..751670f
>> --- /dev/null
>> +++ b/tests/qemu-iotests/051.s390-virtio.out
>> @@ -0,0 +1,377 @@
>> +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=: 
>> could not open disk image TEST_DIR/t.qcow2: 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: 
>> could not open disk image TEST_DIR/t.qcow2: 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: could not open 
>> disk image TEST_DIR/t.qcow2: 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: could not open 
>> disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device 
>> 'virtio0' 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=: could not open 
>> disk image TEST_DIR/t.qcow2: 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: could not 
>> open disk image TEST_DIR/t.qcow2: 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: could not 
>> open disk image TEST_DIR/t.qcow2: 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: could not 
>> open disk image TEST_DIR/t.qcow2: 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: 'foo' invalid 
>> format
>> +
>> +Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
>> +QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open 
>> disk image TEST_DIR/t.qcow2: 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: 
>> could not open disk image TEST_DIR/t.qcow2: Driver specified twice
>> +
>> +
>> +=== 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
>> +virtio0: TEST_DIR/t.qcow2 (qcow2)
>> +    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: 
>> could not open disk image TEST_DIR/t.qcow2: 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: 
>> could not open disk image TEST_DIR/t.qcow2: 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: 
>> could not open disk image TEST_DIR/t.qcow2: 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=: could not open 
>> disk image TEST_DIR/t.qcow2: 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: could not open 
>> disk image TEST_DIR/t.qcow2: 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: could not open 
>> disk image TEST_DIR/t.qcow2: 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: could not open 
>> disk image TEST_DIR/t.qcow2: 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) Warning: Orphaned drive without device: 
>> id=floppy0,file=,if=floppy,bus=0,unit=0
>> +qququiquit
>
> Can't we get rid of these warnings somehow? If nothing else works, 
> filter them out?
OK.
>
> [snip]
>
>> +=== 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 
>> 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"
>
> This is an example of a line that got split into multiple lines in the 
> email. It's fixable by the reviewer, but that requires work. :-)
>
> Max
>
Max Reitz Feb. 9, 2015, 2:35 p.m. UTC | #3
On 2015-02-09 at 03:06, chen xiao guang wrote:
>
> On 02/05/2015 11:11 PM, Max Reitz wrote:
>> On 2015-02-04 at 22:44, Xiao Guang Chen wrote:
>>> From: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
>>>
>>> The tests for device type "ide_cd" are skipped for the s390 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 s390 platform specific output file is also
>>> needed.
>>>
>>> Reviewed-by:   Michael Mueller <mimu@linux.vnet.ibm.com>
>>> Signed-off-by: Mao Chuan Li <maochuan@linux.vnet.ibm.com>
>>> ---
>>>   tests/qemu-iotests/051                 |  91 +++++---
>>>   tests/qemu-iotests/051.s390-virtio.out | 377 
>>> +++++++++++++++++++++++++++++++++
>>>   2 files changed, 439 insertions(+), 29 deletions(-)
>>>   create mode 100644 tests/qemu-iotests/051.s390-virtio.out
>>
>> First: This patch contains lines which are too long to be sent via 
>> email (they are broken up and thus the patch needs manual fixup by 
>> the reviewers). If you could specify a public repository where we 
>> could pull from, that may be helpful to the reviewers.
> I can not find a public repository. Do you have other options?
> Or I manually split the long lines into small ones only for review. 
> But it will not work if you apply the patch.

Well, in that case, better leave it as it is; I have a script for 
"fixing" the patch, so as far as I'm concerned, it's fine.

>>
>> Second: I'm not sure whether s390-virtio should be the special case 
>> here. Maybe "pc" is the platform that is actually special because it 
>> contains a floppy drive, an IDE CD drive and so on. So while this 
>> patch is (nearly?) correct, it may make more sense to move 051.out to 
>> 051.pc.out and modify the current 051.out to be what is 
>> 051.s390-virtio.out in this patch.
>>
> OK.
>> In the same way, maybe all the conditionals in this series (not just 
>> this patch) which check whether the machine type is s390-virtio 
>> should maybe instead check whether the machine type is not pc.
> OK.
>>
>> However, the problem with the pc machine type is that 
>> QEMU_DEFAULT_MACHINE will be version-dependent (currently, it's 
>> pc-i440fx-2.3), so that would require a workaround.
>>
> When we run the qemu-system-x86_64 -machine ? we will get the 
> following output:
> Supported machines are:
> pc                   Standard PC (i440FX + PIIX, 1996) (alias of 
> pc-i440fx-2.3)
> pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996) (default)
> pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-2.1        Standard PC (i440FX + PIIX, 1996)
> ......
>
> We can get the default machine:pc-i440fx-2.3 and the alias of the 
> default machine:pc.
> If the default machine has an alias then we use the alias otherwise we 
> use the default machine.
>
> *qemu/tests/qemu-iotests/common.config:*
> /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/
>
> How about this change?

I don't know awk, but assuming it works it looks good to me.

Max

>> [snip]
>>
>>> diff --git a/tests/qemu-iotests/051.s390-virtio.out 
>>> b/tests/qemu-iotests/051.s390-virtio.out
>>> new file mode 100644
>>> index 0000000..751670f
>>> --- /dev/null
>>> +++ b/tests/qemu-iotests/051.s390-virtio.out
>>> @@ -0,0 +1,377 @@
>>> +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=: 
>>> could not open disk image TEST_DIR/t.qcow2: 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: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: could not open 
>>> disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device 
>>> 'virtio0' 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=: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: could not 
>>> open disk image TEST_DIR/t.qcow2: 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: could not 
>>> open disk image TEST_DIR/t.qcow2: 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: could not 
>>> open disk image TEST_DIR/t.qcow2: 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: 'foo' invalid 
>>> format
>>> +
>>> +Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
>>> +QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: 
>>> could not open disk image TEST_DIR/t.qcow2: Driver specified twice
>>> +
>>> +
>>> +=== 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
>>> +virtio0: TEST_DIR/t.qcow2 (qcow2)
>>> +    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: 
>>> could not open disk image TEST_DIR/t.qcow2: 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: 
>>> could not open disk image TEST_DIR/t.qcow2: 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: 
>>> could not open disk image TEST_DIR/t.qcow2: 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=: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: could not open 
>>> disk image TEST_DIR/t.qcow2: 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: could not 
>>> open disk image TEST_DIR/t.qcow2: 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: could not open 
>>> disk image TEST_DIR/t.qcow2: 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) Warning: Orphaned drive without device: 
>>> id=floppy0,file=,if=floppy,bus=0,unit=0
>>> +qququiquit
>>
>> Can't we get rid of these warnings somehow? If nothing else works, 
>> filter them out?
> OK.
>>
>> [snip]
>>
>>> +=== 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 
>>> 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"
>>
>> This is an example of a line that got split into multiple lines in 
>> the email. It's fixable by the reviewer, but that requires work. :-)
>>
>> Max
>>
>
diff mbox

Patch

diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 11c858f..2b600df 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -137,13 +137,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
+    s390-virtio)
+        ;;
+    *)
+        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 ===
@@ -157,13 +163,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
+    s390-virtio)
+        ;;
+    *)
+        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 ===
@@ -172,12 +184,24 @@  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
+case "$QEMU_DEFAULT_MACHINE" in
+    s390-virtio)
+        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
+        ;;
+    *)
+        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
+        ;;
+esac
 
 echo
 echo === Specifying the protocol layer ===
@@ -241,28 +265,37 @@  echo
 echo === Snapshot mode ===
 echo
 
+case "$QEMU_DEFAULT_MACHINE" in
+    s390-virtio)
+        device_id="virtio0"
+        ;;
+    *)
+        device_id="ide0-hd0"
+        ;;
+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.s390-virtio.out b/tests/qemu-iotests/051.s390-virtio.out
new file mode 100644
index 0000000..751670f
--- /dev/null
+++ b/tests/qemu-iotests/051.s390-virtio.out
@@ -0,0 +1,377 @@ 
+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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: Block format 'qcow2' used by device 'virtio0' 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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: 'foo' invalid format
+
+Testing: -drive file=TEST_DIR/t.qcow2,driver=foo
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,driver=foo: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: Driver specified twice
+
+
+=== 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
+virtio0: TEST_DIR/t.qcow2 (qcow2)
+    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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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=: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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: could not open disk image TEST_DIR/t.qcow2: 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) Warning: Orphaned drive without device: id=floppy0,file=,if=floppy,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=ide,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=ide0-cd0,file=,if=ide,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=scsi,media=cdrom
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=ide
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=ide0-hd0,file=,if=ide,bus=0,unit=0
+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 initialization failed.
+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) Warning: Orphaned drive without device: id=scsi0-hd0,file=,if=scsi,bus=0,unit=0
+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) Warning: Orphaned drive without device: id=floppy0,file=TEST_DIR/t.qcow2,if=floppy,bus=0,unit=0
+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) Warning: Orphaned drive without device: id=ide0-cd0,file=TEST_DIR/t.qcow2,if=ide,bus=0,unit=0
+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) Warning: Orphaned drive without device: id=scsi0-cd0,file=TEST_DIR/t.qcow2,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive file=TEST_DIR/t.qcow2,if=ide,readonly=on
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=ide0-hd0,file=TEST_DIR/t.qcow2,if=ide,bus=0,unit=0
+qququiquit
+
+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) Warning: Orphaned drive without device: id=scsi0-hd0,file=TEST_DIR/t.qcow2,if=scsi,bus=0,unit=0
+qququiquit
+
+
+=== Cache modes ===
+
+Testing: -drive if=scsi,media=cdrom,cache=none
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=directsync
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writeback
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=writethrough
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+qququiquit
+
+Testing: -drive if=scsi,media=cdrom,cache=unsafe
+QEMU X.Y.Z monitor - type 'help' for more information
+(qemu) Warning: Orphaned drive without device: id=scsi0-cd0,file=,if=scsi,bus=0,unit=0
+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: could not open disk image TEST_DIR/t.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: could not open disk image virtio0: The 'file' block driver requires a file name
+
+Testing: -drive driver=nbd
+QEMU_PROG: -drive driver=nbd: could not open disk image virtio0: one of path and host must be specified.
+
+Testing: -drive driver=raw
+QEMU_PROG: -drive driver=raw: could not open disk image virtio0: Can't use 'raw' as a block driver for the protocol level
+
+Testing: -drive file.driver=file
+QEMU_PROG: -drive file.driver=file: could not open disk image virtio0: The 'file' block driver requires a file name
+
+Testing: -drive file.driver=nbd
+QEMU_PROG: -drive file.driver=nbd: could not open disk image virtio0: one of path and host must be specified.
+
+Testing: -drive file.driver=raw
+QEMU_PROG: -drive file.driver=raw: could not open disk image virtio0: Can't use 'raw' as a block driver for the protocol level
+
+Testing: -drive foo=bar
+QEMU_PROG: -drive foo=bar: could not open disk image virtio0: 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: could not open disk image foo:bar: Unknown protocol
+
+Testing: -drive file=foo:bar
+QEMU_PROG: -drive file=foo:bar: could not open disk image foo:bar: Unknown protocol
+
+Testing: -drive file.filename=foo:bar
+QEMU_PROG: -drive file.filename=foo:bar: could not open disk image virtio0: 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 disk image virtio0: 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 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 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 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 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 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 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 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 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
+
+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 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!