]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST
authorPeter Krempa <pkrempa@redhat.com>
Wed, 5 Jan 2022 09:23:42 +0000 (10:23 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 7 Jan 2022 08:25:14 +0000 (09:25 +0100)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
13 files changed:
tests/qemuxml2argvdata/luks-disks.x86_64-4.1.0.args
tests/qemuxml2argvdata/luks-disks.xml
tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
tests/qemuxml2argvdata/memfd-memory-numa.xml
tests/qemuxml2argvdata/vhost-vsock.xml
tests/qemuxml2xmloutdata/luks-disks-source.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/luks-disks-source.xml with 95% similarity]
tests/qemuxml2xmloutdata/luks-disks.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/luks-disks.xml with 100% similarity]
tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/memfd-memory-default-hugepage.xml with 100% similarity]
tests/qemuxml2xmloutdata/memfd-memory-numa.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/memfd-memory-numa.xml with 100% similarity]
tests/qemuxml2xmloutdata/tseg-explicit-size.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/tseg-explicit-size.xml with 61% similarity]
tests/qemuxml2xmloutdata/vhost-vsock-auto.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/vhost-vsock-auto.xml with 88% similarity]
tests/qemuxml2xmloutdata/vhost-vsock.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/vhost-vsock.xml with 100% similarity]
tests/qemuxml2xmltest.c

index a4beb606f471765d45237677a7980433a8574fbe..27f567642c77b6c360a61e02a6c45edfbfa8b55f 100644 (file)
@@ -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 \
index 1c76f0dc260a7c570a7e56f534316d029a7e2818..93718daaf4a3d03b578727fe61fa5b02d9f595a1 100644 (file)
@@ -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'/>
index 6e2f83c8a9cd9e9c11053e7ad5af2294c9c3da46..238d4c6b529795a133ee1a939bd4fa163069e2f9 100644 (file)
@@ -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'/>
index d9e1a9f564aa0ad58b65b6ccfe48da3637e815f7..1ebcee8939f9bce61c1aefb7799f20a29ddc3ebc 100644 (file)
@@ -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'/>
index 68eab383197b0e900b95b073f959396e631889a6..e95b0b736ac8d290ca49ec6ba6f8ed51a72a6a35 100644 (file)
@@ -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'>
similarity index 95%
rename from tests/qemuxml2xmloutdata/luks-disks-source.xml
rename to tests/qemuxml2xmloutdata/luks-disks-source.x86_64-latest.xml
index 891b5d9d1717d540f5bfe6aa3a1e262b59f812e4..ed9df66413bdae6522a2d0a6396fecb6fa25f772 100644 (file)
@@ -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'/>
similarity index 61%
rename from tests/qemuxml2xmloutdata/tseg-explicit-size.xml
rename to tests/qemuxml2xmloutdata/tseg-explicit-size.x86_64-latest.xml
index 791b34f864adc90aa9208675ad7c2c526327ba1c..78ffe820cfa1cc367e5080ae3ab62fa0f95d3e68 100644 (file)
       <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>
similarity index 88%
rename from tests/qemuxml2xmloutdata/vhost-vsock-auto.xml
rename to tests/qemuxml2xmloutdata/vhost-vsock-auto.x86_64-latest.xml
index c1b787cdc47e1ed2abe12203d0b4c970d173764e..ea8daf34c7c23a4f05feec358040fa89ca38bdc5 100644 (file)
@@ -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'>
index f415a2245bb78109048f2adf53a813f4f7b13135..4ea1ee5e0f6480bc2d13bccafe036016d286549e 100644 (file)
@@ -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,