This adds and corrects testcases for virtio devices on s390
guests.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
V2 Changes
- adapt the testcase XML files to use the new attributes
- use different variations for the values: hex, decimal, leading zeroes...
V3 Changes
- add virtio-s390 caps to all ccw tests to reflect reality
V4 Changes
- replace schid with devno in xml files
.../qemuxml2argv-console-virtio-ccw.args | 10 +++++
.../qemuxml2argv-console-virtio-ccw.xml | 27 +++++++++++++
.../qemuxml2argv-console-virtio-s390.args | 4 +-
.../qemuxml2argv-console-virtio-s390.xml | 2 +-
.../qemuxml2argv-disk-virtio-ccw-many.args | 12 ++++++
.../qemuxml2argv-disk-virtio-ccw-many.xml | 40 ++++++++++++++++++++
.../qemuxml2argv-disk-virtio-ccw.args | 8 ++++
.../qemuxml2argv-disk-virtio-ccw.xml | 30 +++++++++++++++
.../qemuxml2argv-net-virtio-ccw.args | 8 ++++
.../qemuxml2argv-net-virtio-ccw.xml | 30 +++++++++++++++
tests/qemuxml2argvtest.c | 12 +++++-
tests/testutilsqemu.c | 3 +-
12 files changed, 181 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
new file mode 100644
index 0000000..6660a30
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
@@ -0,0 +1,10 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
+s390-ccw -m 214 -smp 1 -nographic -nodefconfig -nodefaults -chardev \
+socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon \
+chardev=charmonitor,id=monitor,mode=readline -no-acpi \
+-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0001 \
+-usb -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
+-device
virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
+-chardev pty,id=charconsole0 \
+-device virtconsole,chardev=charconsole0,id=console0 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml
b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml
new file mode 100644
index 0000000..855a9d2
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219100</memory>
+ <currentMemory>219100</currentMemory>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <boot order='1'/>
+ </disk>
+ <console type='pty'>
+ <target type='virtio'/>
+ </console>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0'
devno='0x000a'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
index 3bd7817..bf7b180 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
@@ -2,8 +2,8 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S
-M \
s390-virtio -m 214 -smp 1 -nographic -nodefconfig -nodefaults -chardev \
socket,id=charmonitor,path=/tmp/test-monitor,server,nowait -mon \
chardev=charmonitor,id=monitor,mode=readline -no-acpi \
--boot c -device virtio-serial-s390,id=virtio-serial0 \
+-device virtio-serial-s390,id=virtio-serial0 \
-usb -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
--device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0 \
+-device virtio-blk-s390,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charconsole0 \
-device virtconsole,chardev=charconsole0,id=console0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
index 5a4a9d4..221232d 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
@@ -5,7 +5,6 @@
<currentMemory>219100</currentMemory>
<os>
<type arch='s390x' machine='s390-virtio'>hvm</type>
- <boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
@@ -16,6 +15,7 @@
<disk type='block' device='disk'>
<source dev='/dev/HostVG/QEMUGuest1'/>
<target dev='hda' bus='virtio'/>
+ <boot order='1'/>
</disk>
<console type='pty'>
<target type='virtio'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args
new file mode 100644
index 0000000..ca0c157
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args
@@ -0,0 +1,12 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
+-M s390-ccw -m 214 -smp 1 -nographic -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-usb -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-ccw,devno=0.0.0007,drive=drive-virtio-disk0,id=virtio-disk0 \
+-drive file=/dev/HostVG/QEMUGuest4,if=none,id=drive-virtio-disk1 \
+-device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk1,id=virtio-disk1 \
+-drive file=/dev/HostVG/QEMUGuest2,if=none,id=drive-virtio-disk2 \
+-device virtio-blk-ccw,devno=fe.0.0001,drive=drive-virtio-disk2,id=virtio-disk2 \
+-drive file=/dev/HostVG/QEMUGuest3,if=none,id=drive-virtio-disk3 \
+-device virtio-blk-ccw,devno=fe.2.f00f,drive=drive-virtio-disk3,id=virtio-disk3 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
new file mode 100644
index 0000000..6c2772b
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
@@ -0,0 +1,40 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ <address type='ccw' cssid='0' ssid='0x0'
devno='7'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest2'/>
+ <target dev='hdc' bus='virtio'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest3'/>
+ <target dev='hdd' bus='virtio'/>
+ <address type='ccw' cssid='254' ssid='2'
devno='0xf00f'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest4'/>
+ <target dev='hdb' bus='virtio'/>
+ <address type='ccw'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0a'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args
new file mode 100644
index 0000000..ec901bb
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args
@@ -0,0 +1,8 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
+-M s390-ccw -m 214 -smp 1 -nographic -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-usb -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,id=virtio-disk0 \
+-drive file=/dev/HostVG/QEMUGuest2,if=none,id=drive-virtio-disk1 \
+-device virtio-blk-ccw,devno=0.0.0007,drive=drive-virtio-disk1,id=virtio-disk1 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml
new file mode 100644
index 0000000..6f4bd2a
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='virtio'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest2'/>
+ <target dev='hdb' bus='virtio'/>
+ <address type='ccw' cssid='0' ssid='0'
devno='7'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='0xFe' ssid='0x0'
devno='0xA'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args
b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args
new file mode 100644
index 0000000..f874afe
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args
@@ -0,0 +1,8 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S \
+-M s390-ccw -m 214 -smp 1 -nographic -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
+-usb -device virtio-net-ccw,vlan=0,id=net0,mac=00:11:22:33:44:55,devno=fe.0.0001 \
+-net user,vlan=0,name=hostnet0 \
+-device virtio-net-ccw,vlan=1,id=net1,mac=00:11:22:33:44:54,devno=fe.0.0000 \
+-net user,vlan=1,name=hostnet1 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.000a
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml
b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml
new file mode 100644
index 0000000..48ea8ec
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:55'/>
+ <model type='virtio'/>
+ </interface>
+ <interface type='user'>
+ <mac address='00:11:22:33:44:54'/>
+ <model type='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0'/>
+ </interface>
+ <memballoon model='virtio'>
+ <address type='ccw' cssid='254' ssid='0'
devno='10'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index b6b5489..b900515 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -438,6 +438,10 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_S390);
DO_TEST("disk-many", NONE);
DO_TEST("disk-virtio", QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT);
+ DO_TEST("disk-virtio-ccw", QEMU_CAPS_DRIVE,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
+ DO_TEST("disk-virtio-ccw-many", QEMU_CAPS_DRIVE,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
DO_TEST("disk-order",
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE_BOOT,
QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO);
@@ -625,6 +629,8 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("net-virtio-s390",
QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_S390);
+ DO_TEST("net-virtio-ccw",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
DO_TEST("net-eth", NONE);
DO_TEST("net-eth-ifname", NONE);
DO_TEST("net-eth-names", QEMU_CAPS_NET_NAME);
@@ -684,7 +690,11 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("console-virtio-s390",
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
- QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_S390);
+ QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_S390);
+ DO_TEST("console-virtio-ccw",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
+ QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX, QEMU_CAPS_VIRTIO_CCW,
+ QEMU_CAPS_VIRTIO_S390);
DO_TEST("console-sclp",
QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_S390, QEMU_CAPS_SCLP_S390);
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 966527c..c09d013 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -94,7 +94,8 @@ error:
static int testQemuAddS390Guest(virCapsPtr caps)
{
- static const char *s390_machines[] = { "s390-virtio"};
+ static const char *s390_machines[] = { "s390-virtio",
+ "s390-ccw-virtio" };
virCapsGuestMachinePtr *machines = NULL;
virCapsGuestPtr guest;
--
1.7.9.5