This adds and corrects testcases for virtio devices on s390
guests.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
.../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 | 39 ++++++++++++++++++++
.../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 | 11 +++++-
tests/testutilsqemu.c | 3 +-
12 files changed, 179 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..4dfbe18
--- /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' devno='fe.0.000a'/>
+ </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..f901ccd
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml
@@ -0,0 +1,39 @@
+<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' devno='0.0.0007'/>
+ </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' devno='fe.2.f00f'/>
+ </disk>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest4'/>
+ <target dev='hdb' bus='virtio'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='ccw' devno='fe.0.000a'/>
+ </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..e87cca7
--- /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' devno='0.0.0007'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='ccw' devno='fe.0.000a'/>
+ </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..24b837b
--- /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' devno='fe.0.0000'/>
+ </interface>
+ <memballoon model='virtio'>
+ <address type='ccw' devno='fe.0.000a'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 88e1c36..8eac709 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -423,6 +423,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);
+ DO_TEST("disk-virtio-ccw-many", QEMU_CAPS_DRIVE,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_CCW);
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);
@@ -611,6 +615,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);
DO_TEST("net-eth", NONE);
DO_TEST("net-eth-ifname", NONE);
DO_TEST("net-eth-names", QEMU_CAPS_NET_NAME);
@@ -670,7 +676,10 @@ 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);
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 573927d..ca52776 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