[PATCH 19/21] qemuxml2xmltest: Modernize 'mach-virt*' cases

Peter Krempa pkrempa at redhat.com
Fri Mar 31 11:26:13 UTC 2023


Use real capabilities.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 ...ch-virt-console-native.aarch64-latest.xml} |  4 +++
 ...ch-virt-console-virtio.aarch64-latest.xml} | 16 +++++++++++-
 ...-serial+console-native.aarch64-latest.xml} |  4 +++
 ...ach-virt-serial-compat.aarch64-latest.xml} |  4 +++
 ...ach-virt-serial-native.aarch64-latest.xml} |  4 +++
 ...> mach-virt-serial-pci.aarch64-latest.xml} | 19 ++++++++------
 ...> mach-virt-serial-usb.aarch64-latest.xml} |  3 +++
 tests/qemuxml2xmltest.c                       | 25 ++++++-------------
 8 files changed, 52 insertions(+), 27 deletions(-)
 rename tests/qemuxml2xmloutdata/{mach-virt-console-native.xml => mach-virt-console-native.aarch64-latest.xml} (84%)
 rename tests/qemuxml2xmloutdata/{mach-virt-console-virtio.xml => mach-virt-console-virtio.aarch64-latest.xml} (52%)
 rename tests/qemuxml2xmloutdata/{mach-virt-serial-native.xml => mach-virt-serial+console-native.aarch64-latest.xml} (84%)
 rename tests/qemuxml2xmloutdata/{mach-virt-serial+console-native.xml => mach-virt-serial-compat.aarch64-latest.xml} (84%)
 rename tests/qemuxml2xmloutdata/{mach-virt-serial-compat.xml => mach-virt-serial-native.aarch64-latest.xml} (84%)
 rename tests/qemuxml2xmloutdata/{mach-virt-serial-pci.xml => mach-virt-serial-pci.aarch64-latest.xml} (71%)
 rename tests/qemuxml2xmloutdata/{mach-virt-serial-usb.xml => mach-virt-serial-usb.aarch64-latest.xml} (93%)

diff --git a/tests/qemuxml2xmloutdata/mach-virt-console-native.xml b/tests/qemuxml2xmloutdata/mach-virt-console-native.aarch64-latest.xml
similarity index 84%
rename from tests/qemuxml2xmloutdata/mach-virt-console-native.xml
rename to tests/qemuxml2xmloutdata/mach-virt-console-native.aarch64-latest.xml
index f66fe2916a..66da5927e3 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-console-native.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-console-native.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -18,6 +21,7 @@
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
     <serial type='pty'>
       <target type='system-serial' port='0'>
         <model name='pl011'/>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-console-virtio.xml b/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml
similarity index 52%
rename from tests/qemuxml2xmloutdata/mach-virt-console-virtio.xml
rename to tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml
index 6224089879..e1ff62f2c5 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-console-virtio.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-console-virtio.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -18,8 +21,19 @@
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
     <controller type='virtio-serial' index='0'>
-      <address type='virtio-mmio'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    </controller>
+    <controller type='pci' index='1' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='1' port='0x8'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='pci' index='2' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='2' port='0x9'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <console type='pty'>
       <target type='virtio' port='0'/>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-serial-native.xml b/tests/qemuxml2xmloutdata/mach-virt-serial+console-native.aarch64-latest.xml
similarity index 84%
rename from tests/qemuxml2xmloutdata/mach-virt-serial-native.xml
rename to tests/qemuxml2xmloutdata/mach-virt-serial+console-native.aarch64-latest.xml
index f66fe2916a..66da5927e3 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-serial-native.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-serial+console-native.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -18,6 +21,7 @@
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
     <serial type='pty'>
       <target type='system-serial' port='0'>
         <model name='pl011'/>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-serial+console-native.xml b/tests/qemuxml2xmloutdata/mach-virt-serial-compat.aarch64-latest.xml
similarity index 84%
rename from tests/qemuxml2xmloutdata/mach-virt-serial+console-native.xml
rename to tests/qemuxml2xmloutdata/mach-virt-serial-compat.aarch64-latest.xml
index f66fe2916a..66da5927e3 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-serial+console-native.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-serial-compat.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -18,6 +21,7 @@
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
     <serial type='pty'>
       <target type='system-serial' port='0'>
         <model name='pl011'/>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-serial-compat.xml b/tests/qemuxml2xmloutdata/mach-virt-serial-native.aarch64-latest.xml
similarity index 84%
rename from tests/qemuxml2xmloutdata/mach-virt-serial-compat.xml
rename to tests/qemuxml2xmloutdata/mach-virt-serial-native.aarch64-latest.xml
index f66fe2916a..66da5927e3 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-serial-compat.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-serial-native.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -18,6 +21,7 @@
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
+    <controller type='pci' index='0' model='pcie-root'/>
     <serial type='pty'>
       <target type='system-serial' port='0'>
         <model name='pl011'/>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-serial-pci.xml b/tests/qemuxml2xmloutdata/mach-virt-serial-pci.aarch64-latest.xml
similarity index 71%
rename from tests/qemuxml2xmloutdata/mach-virt-serial-pci.xml
rename to tests/qemuxml2xmloutdata/mach-virt-serial-pci.aarch64-latest.xml
index 09478419e2..abf8407a72 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-serial-pci.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-serial-pci.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -19,19 +22,19 @@
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
     <controller type='usb' index='0' model='none'/>
     <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
-      <model name='i82801b11-bridge'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    <controller type='pci' index='1' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='1' port='0x8'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
     </controller>
-    <controller type='pci' index='2' model='pci-bridge'>
-      <model name='pci-bridge'/>
-      <target chassisNr='2'/>
+    <controller type='pci' index='2' model='pcie-to-pci-bridge'>
+      <model name='pcie-pci-bridge'/>
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='3' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='3' port='0x10'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+      <target chassis='3' port='0x9'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
     <serial type='pty'>
       <target type='pci-serial' port='0'>
diff --git a/tests/qemuxml2xmloutdata/mach-virt-serial-usb.xml b/tests/qemuxml2xmloutdata/mach-virt-serial-usb.aarch64-latest.xml
similarity index 93%
rename from tests/qemuxml2xmloutdata/mach-virt-serial-usb.xml
rename to tests/qemuxml2xmloutdata/mach-virt-serial-usb.aarch64-latest.xml
index 0578d7ad72..9afbeee12d 100644
--- a/tests/qemuxml2xmloutdata/mach-virt-serial-usb.xml
+++ b/tests/qemuxml2xmloutdata/mach-virt-serial-usb.aarch64-latest.xml
@@ -11,6 +11,9 @@
   <features>
     <gic version='2'/>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 61474ecb0d..64edd26faf 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -643,24 +643,13 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("pseries-console-native", "ppc64");
     DO_TEST_CAPS_ARCH_LATEST("pseries-console-virtio", "ppc64");

-    DO_TEST_NOCAPS("mach-virt-serial-native");
-    DO_TEST_NOCAPS("mach-virt-serial+console-native");
-    DO_TEST_NOCAPS("mach-virt-serial-compat");
-    DO_TEST("mach-virt-serial-pci",
-            QEMU_CAPS_OBJECT_GPEX,
-            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
-            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCI_SERIAL);
-    DO_TEST("mach-virt-serial-usb",
-            QEMU_CAPS_OBJECT_GPEX,
-            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
-            QEMU_CAPS_DEVICE_QEMU_XHCI,
-            QEMU_CAPS_DEVICE_USB_SERIAL);
-    DO_TEST("mach-virt-console-native",
-            QEMU_CAPS_DEVICE_PL011);
-    DO_TEST("mach-virt-console-virtio",
-            QEMU_CAPS_DEVICE_VIRTIO_MMIO);
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-serial-native", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-serial+console-native", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-serial-compat", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-serial-pci", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-serial-usb", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-console-native", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("mach-virt-console-virtio", "aarch64");

     DO_TEST_NOCAPS("balloon-device-auto");
     DO_TEST_NOCAPS("balloon-device-period");
-- 
2.39.2



More information about the libvir-list mailing list