]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
S390: Testcases for virtio-ccw machines
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Tue, 5 Mar 2013 15:44:23 +0000 (16:44 +0100)
committerEric Blake <eblake@redhat.com>
Thu, 14 Mar 2013 00:21:50 +0000 (18:21 -0600)
This adds and corrects testcases for virtio devices on s390
guests.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 files changed:
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.args
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-s390.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw-many.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/testutilsqemu.c

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-console-virtio-ccw.args
new file mode 100644 (file)
index 0000000..6660a30
--- /dev/null
@@ -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 (file)
index 0000000..855a9d2
--- /dev/null
@@ -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>
index 3bd781709cf27b8747e8c61d0c0492f6f9b9e4f7..bf7b1806954867368470d91e47fa3e9ac8c33bd3 100644 (file)
@@ -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
index 5a4a9d4e949f72387089fb00b4c2a89005b9635f..221232de11349ca196f0dabb6d14b89826dd6c54 100644 (file)
@@ -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 (file)
index 0000000..ca0c157
--- /dev/null
@@ -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 (file)
index 0000000..6c2772b
--- /dev/null
@@ -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 (file)
index 0000000..ec901bb
--- /dev/null
@@ -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 (file)
index 0000000..6f4bd2a
--- /dev/null
@@ -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 (file)
index 0000000..f874afe
--- /dev/null
@@ -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 (file)
index 0000000..48ea8ec
--- /dev/null
@@ -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>
index 888de3c856162acc457b588846da9163ffd77959..a9a555741bd84b7d5135c432074647b678f7b8d0 100644 (file)
@@ -440,6 +440,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);
@@ -627,6 +631,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);
@@ -686,7 +692,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);
index 27cf64718a99babbed439fb5ffb32787628834c7..4e13db915fec5dae2596c475d2bea4e0e97e7f57 100644 (file)
@@ -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;