[PATCH 09/21] qemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST

Peter Krempa pkrempa at redhat.com
Thu Jan 6 09:44:08 UTC 2022


The qemuxml2argv invocation of some tests used DO_TEST_CAPS_LATEST while
the qemuxml2xmltest invocation uses fake caps. Unify them on
DO_TEST_CAPS_LATEST.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 .../luks-disks.x86_64-4.1.0.args              |  1 +
 tests/qemuxml2argvdata/luks-disks.xml         |  5 +++-
 .../memfd-memory-default-hugepage.xml         |  5 ++--
 tests/qemuxml2argvdata/memfd-memory-numa.xml  |  5 ++--
 tests/qemuxml2argvdata/vhost-vsock.xml        |  5 +++-
 ...ml => luks-disks-source.x86_64-latest.xml} |  5 +++-
 ...disks.xml => luks-disks.x86_64-latest.xml} |  0
 ...memory-default-hugepage.x86_64-latest.xml} |  0
 ...ml => memfd-memory-numa.x86_64-latest.xml} |  0
 ...l => tseg-explicit-size.x86_64-latest.xml} | 29 ++++++++++++-------
 ...xml => vhost-vsock-auto.x86_64-latest.xml} |  5 +++-
 ...sock.xml => vhost-vsock.x86_64-latest.xml} |  0
 tests/qemuxml2xmltest.c                       | 27 +++++------------
 13 files changed, 48 insertions(+), 39 deletions(-)
 rename tests/qemuxml2xmloutdata/{luks-disks-source.xml => luks-disks-source.x86_64-latest.xml} (95%)
 rename tests/qemuxml2xmloutdata/{luks-disks.xml => luks-disks.x86_64-latest.xml} (100%)
 rename tests/qemuxml2xmloutdata/{memfd-memory-default-hugepage.xml => memfd-memory-default-hugepage.x86_64-latest.xml} (100%)
 rename tests/qemuxml2xmloutdata/{memfd-memory-numa.xml => memfd-memory-numa.x86_64-latest.xml} (100%)
 rename tests/qemuxml2xmloutdata/{tseg-explicit-size.xml => tseg-explicit-size.x86_64-latest.xml} (61%)
 rename tests/qemuxml2xmloutdata/{vhost-vsock-auto.xml => vhost-vsock-auto.x86_64-latest.xml} (88%)
 rename tests/qemuxml2xmloutdata/{vhost-vsock.xml => vhost-vsock.x86_64-latest.xml} (100%)

diff --git a/tests/qemuxml2argvdata/luks-disks.x86_64-4.1.0.args b/tests/qemuxml2argvdata/luks-disks.x86_64-4.1.0.args
index a4beb606f4..27f567642c 100644
--- a/tests/qemuxml2argvdata/luks-disks.x86_64-4.1.0.args
+++ b/tests/qemuxml2argvdata/luks-disks.x86_64-4.1.0.args
@@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=none \
 -object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-encryptdisk/master-key.aes \
 -machine pc-i440fx-2.1,usb=off,dump-guest-core=off \
 -accel tcg \
+-cpu qemu64 \
 -m 1024 \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
diff --git a/tests/qemuxml2argvdata/luks-disks.xml b/tests/qemuxml2argvdata/luks-disks.xml
index 1c76f0dc26..93718daaf4 100644
--- a/tests/qemuxml2argvdata/luks-disks.xml
+++ b/tests/qemuxml2argvdata/luks-disks.xml
@@ -8,6 +8,9 @@
     <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
     <boot dev='hd'/>
   </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -32,7 +35,7 @@
       </encryption>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
     </disk>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
index 6e2f83c8a9..238d4c6b52 100644
--- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
+++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
@@ -17,7 +17,8 @@
     <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
     <topology sockets='1' dies='1' cores='8' threads='1'/>
     <numa>
       <cell id='0' cpus='0-7' memory='14680064' unit='KiB'/>
@@ -29,7 +30,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.xml b/tests/qemuxml2argvdata/memfd-memory-numa.xml
index d9e1a9f564..1ebcee8939 100644
--- a/tests/qemuxml2argvdata/memfd-memory-numa.xml
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.xml
@@ -20,7 +20,8 @@
     <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
     <boot dev='hd'/>
   </os>
-  <cpu>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
     <topology sockets='1' dies='1' cores='8' threads='1'/>
     <numa>
       <cell id='0' cpus='0-7' memory='14680064' unit='KiB'/>
@@ -32,7 +33,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxml2argvdata/vhost-vsock.xml b/tests/qemuxml2argvdata/vhost-vsock.xml
index 68eab38319..e95b0b736a 100644
--- a/tests/qemuxml2argvdata/vhost-vsock.xml
+++ b/tests/qemuxml2argvdata/vhost-vsock.xml
@@ -9,13 +9,16 @@
     <boot dev='hd'/>
     <bootmenu enable='yes'/>
   </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='virtio-serial' index='0'>
diff --git a/tests/qemuxml2xmloutdata/luks-disks-source.xml b/tests/qemuxml2xmloutdata/luks-disks-source.x86_64-latest.xml
similarity index 95%
rename from tests/qemuxml2xmloutdata/luks-disks-source.xml
rename to tests/qemuxml2xmloutdata/luks-disks-source.x86_64-latest.xml
index 891b5d9d17..ed9df66413 100644
--- a/tests/qemuxml2xmloutdata/luks-disks-source.xml
+++ b/tests/qemuxml2xmloutdata/luks-disks-source.x86_64-latest.xml
@@ -8,6 +8,9 @@
     <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
     <boot dev='hd'/>
   </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
@@ -71,7 +74,7 @@
       <target dev='vde' bus='virtio'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
     </disk>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxml2xmloutdata/luks-disks.xml b/tests/qemuxml2xmloutdata/luks-disks.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/luks-disks.xml
rename to tests/qemuxml2xmloutdata/luks-disks.x86_64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml b/tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml
rename to tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.x86_64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/memfd-memory-numa.xml b/tests/qemuxml2xmloutdata/memfd-memory-numa.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/memfd-memory-numa.xml
rename to tests/qemuxml2xmloutdata/memfd-memory-numa.x86_64-latest.xml
diff --git a/tests/qemuxml2xmloutdata/tseg-explicit-size.xml b/tests/qemuxml2xmloutdata/tseg-explicit-size.x86_64-latest.xml
similarity index 61%
rename from tests/qemuxml2xmloutdata/tseg-explicit-size.xml
rename to tests/qemuxml2xmloutdata/tseg-explicit-size.x86_64-latest.xml
index 791b34f864..78ffe820cf 100644
--- a/tests/qemuxml2xmloutdata/tseg-explicit-size.xml
+++ b/tests/qemuxml2xmloutdata/tseg-explicit-size.x86_64-latest.xml
@@ -13,35 +13,42 @@
       <tseg unit='MiB'>48</tseg>
     </smm>
   </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <controller type='usb' index='0' model='qemu-xhci'>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
     </controller>
     <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='0x1e' 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'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    <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>
     <controller type='pci' index='3' model='pcie-root-port'>
-      <model name='ioh3420'/>
-      <target chassis='3' port='0x8'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <model name='pcie-root-port'/>
+      <target chassis='3' port='0xa'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <input type='mouse' bus='ps2'/>
     <input type='keyboard' bus='ps2'/>
     <audio id='1' type='none'/>
     <memballoon model='virtio'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
     </memballoon>
   </devices>
 </domain>
diff --git a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml b/tests/qemuxml2xmloutdata/vhost-vsock-auto.x86_64-latest.xml
similarity index 88%
rename from tests/qemuxml2xmloutdata/vhost-vsock-auto.xml
rename to tests/qemuxml2xmloutdata/vhost-vsock-auto.x86_64-latest.xml
index c1b787cdc4..ea8daf34c7 100644
--- a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml
+++ b/tests/qemuxml2xmloutdata/vhost-vsock-auto.x86_64-latest.xml
@@ -9,13 +9,16 @@
     <boot dev='hd'/>
     <bootmenu enable='yes'/>
   </os>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>qemu64</model>
+  </cpu>
   <clock offset='utc'/>
   <on_poweroff>destroy</on_poweroff>
   <on_reboot>restart</on_reboot>
   <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0'>
+    <controller type='usb' index='0' model='piix3-uhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
     <controller type='virtio-serial' index='0'>
diff --git a/tests/qemuxml2xmloutdata/vhost-vsock.xml b/tests/qemuxml2xmloutdata/vhost-vsock.x86_64-latest.xml
similarity index 100%
rename from tests/qemuxml2xmloutdata/vhost-vsock.xml
rename to tests/qemuxml2xmloutdata/vhost-vsock.x86_64-latest.xml
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index f415a2245b..4ea1ee5e0f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -528,8 +528,8 @@ mymain(void)

     DO_TEST("encrypted-disk", QEMU_CAPS_QCOW2_LUKS);
     DO_TEST("encrypted-disk-usage", QEMU_CAPS_QCOW2_LUKS);
-    DO_TEST_NOCAPS("luks-disks");
-    DO_TEST_NOCAPS("luks-disks-source");
+    DO_TEST_CAPS_LATEST("luks-disks");
+    DO_TEST_CAPS_LATEST("luks-disks-source");
     DO_TEST_CAPS_LATEST("luks-disks-source-qcow2");
     DO_TEST_NOCAPS("memtune");
     DO_TEST_NOCAPS("memtune-unlimited");
@@ -1236,15 +1236,8 @@ mymain(void)
     DO_TEST("fd-memory-no-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
             QEMU_CAPS_KVM);

-    DO_TEST("memfd-memory-numa",
-            QEMU_CAPS_OBJECT_MEMORY_MEMFD,
-            QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB,
-            QEMU_CAPS_OBJECT_MEMORY_FILE,
-            QEMU_CAPS_DEVICE_NVDIMM);
-    DO_TEST("memfd-memory-default-hugepage",
-            QEMU_CAPS_OBJECT_MEMORY_MEMFD,
-            QEMU_CAPS_OBJECT_MEMORY_MEMFD_HUGETLB,
-            QEMU_CAPS_OBJECT_MEMORY_FILE);
+    DO_TEST_CAPS_LATEST("memfd-memory-numa");
+    DO_TEST_CAPS_LATEST("memfd-memory-default-hugepage");

     DO_TEST_NOCAPS("acpi-table");

@@ -1319,16 +1312,10 @@ mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW,
             QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW);

-    DO_TEST("tseg-explicit-size",
-            QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_PCI_BRIDGE,
-            QEMU_CAPS_DEVICE_IOH3420,
-            QEMU_CAPS_ICH9_AHCI,
-            QEMU_CAPS_VIRTIO_SCSI,
-            QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES);
+    DO_TEST_CAPS_LATEST("tseg-explicit-size");

-    DO_TEST("vhost-vsock", QEMU_CAPS_DEVICE_VHOST_VSOCK);
-    DO_TEST("vhost-vsock-auto", QEMU_CAPS_DEVICE_VHOST_VSOCK);
+    DO_TEST_CAPS_LATEST("vhost-vsock");
+    DO_TEST_CAPS_LATEST("vhost-vsock-auto");
     DO_TEST("vhost-vsock-ccw", QEMU_CAPS_DEVICE_VHOST_VSOCK,
             QEMU_CAPS_CCW);
     DO_TEST("vhost-vsock-ccw-auto", QEMU_CAPS_DEVICE_VHOST_VSOCK,
-- 
2.31.1




More information about the libvir-list mailing list