[PATCH libvirt v1 2/6] tests: qemu: add tests for ZPCI on s390

Shalini Chellathurai Saroja shalini at linux.ibm.com
Thu Apr 9 10:31:01 UTC 2020


Add test to verify ZPCI address validation with uid set to 0x0

Signed-off-by: Bjoern Walk <bwalk at linux.ibm.com>
Signed-off-by: Shalini Chellathurai Saroja <shalini at linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk at linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
---
 .../hostdev-vfio-zpci-uid-set-zero.xml        | 20 +++++++++++++++++++
 tests/qemuxml2argvtest.c                      |  3 +++
 2 files changed, 23 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-uid-set-zero.xml

diff --git a/tests/qemuxml2argvdata/hostdev-vfio-zpci-uid-set-zero.xml b/tests/qemuxml2argvdata/hostdev-vfio-zpci-uid-set-zero.xml
new file mode 100644
index 00000000..6bfbfe61
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-vfio-zpci-uid-set-zero.xml
@@ -0,0 +1,20 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory>219100</memory>
+  <os>
+    <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-s390x</emulator>
+    <hostdev mode='subsystem' type='pci'>
+      <driver name='vfio'/>
+      <source>
+        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
+      </source>
+      <address type='pci'>
+        <zpci uid='0x0'/>
+      </address>
+    </hostdev>
+  </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 405227fd..dd467cb3 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1650,6 +1650,9 @@ mymain(void)
     DO_TEST("hostdev-vfio-zpci-autogenerate",
             QEMU_CAPS_DEVICE_VFIO_PCI,
             QEMU_CAPS_DEVICE_ZPCI);
+    DO_TEST_PARSE_ERROR("hostdev-vfio-zpci-uid-set-zero",
+            QEMU_CAPS_DEVICE_VFIO_PCI,
+            QEMU_CAPS_DEVICE_ZPCI);
     DO_TEST("hostdev-vfio-zpci-boundaries",
             QEMU_CAPS_DEVICE_VFIO_PCI,
             QEMU_CAPS_DEVICE_PCI_BRIDGE,
-- 
2.21.1





More information about the libvir-list mailing list