]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvtest: Modernize the rest of 'iohtreads-*'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 22 Feb 2023 14:23:04 +0000 (15:23 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 6 Mar 2023 12:22:36 +0000 (13:22 +0100)
Use DO_TEST_CAPS_LATEST for the basic tests. The emulator needed to be
tweaked to work with the real caps data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/iothreads-disk.x86_64-latest.args [moved from tests/qemuxml2argvdata/iothreads-disk.args with 60% similarity]
tests/qemuxml2argvdata/iothreads-disk.xml
tests/qemuxml2argvdata/iothreads-ids-partial.x86_64-latest.args [moved from tests/qemuxml2argvdata/iothreads-ids.args with 54% similarity]
tests/qemuxml2argvdata/iothreads-ids-partial.xml
tests/qemuxml2argvdata/iothreads-ids.x86_64-latest.args [moved from tests/qemuxml2argvdata/iothreads-ids-partial.args with 58% similarity]
tests/qemuxml2argvdata/iothreads-ids.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/iothreads-disk.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/iothreads-disk.xml with 86% similarity]
tests/qemuxml2xmloutdata/iothreads-ids-partial.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/iothreads-ids-partial.xml with 82% similarity]
tests/qemuxml2xmloutdata/iothreads-ids.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/iothreads-ids.xml with 82% similarity]
tests/qemuxml2xmltest.c

similarity index 60%
rename from tests/qemuxml2argvdata/iothreads-disk.args
rename to tests/qemuxml2argvdata/iothreads-disk.x86_64-latest.args
index ef80cf400851094b8b3b4c4b8dcf6d7fc2782b7e..1f18c97c9742521b709645bf1f54748034519971 100644 (file)
@@ -6,17 +6,19 @@ LOGNAME=test \
 XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
 XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-i386 \
+/usr/bin/qemu-system-x86_64 \
 -name guest=QEMUGuest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,usb=off,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
 -accel tcg \
+-cpu qemu64 \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 2,sockets=2,cores=1,threads=1 \
--object iothread,id=iothread1 \
--object iothread,id=iothread2 \
+-object '{"qom-type":"iothread","id":"iothread1"}' \
+-object '{"qom-type":"iothread","id":"iothread2"}' \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \
@@ -27,15 +29,16 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
--usb \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw","file":"libvirt-3-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-3-format,id=ide0-0-0,bootindex=1 \
+-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-format","id":"ide0-0-0","bootindex":1}' \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest1.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}' \
--device virtio-blk-pci,iothread=iothread1,bus=pci.0,addr=0x4,drive=libvirt-2-format,id=virtio-disk1 \
+-device '{"driver":"virtio-blk-pci","iothread":"iothread1","bus":"pci.0","addr":"0x4","drive":"libvirt-2-format","id":"virtio-disk1"}' \
 -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/iothrtest2.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device virtio-blk-pci,iothread=iothread2,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk2 \
+-device '{"driver":"virtio-blk-pci","iothread":"iothread2","bus":"pci.0","addr":"0x2","drive":"libvirt-1-format","id":"virtio-disk2"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index bbfac34db59f624377ed82fb66e9218e995aafec..485ae3760ef20c79291b7750cc253242c5e13a4e 100644 (file)
@@ -6,7 +6,7 @@
   <vcpu placement='static'>2</vcpu>
   <iothreads>2</iothreads>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -14,7 +14,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
similarity index 54%
rename from tests/qemuxml2argvdata/iothreads-ids.args
rename to tests/qemuxml2argvdata/iothreads-ids-partial.x86_64-latest.args
index ddb79f9bef95423b8d0cce84e5ee7831e3fdac93..857e343f8de78439f4530e29d9073e6cfa614153 100644 (file)
@@ -6,17 +6,21 @@ LOGNAME=test \
 XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
 XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-i386 \
+/usr/bin/qemu-system-x86_64 \
 -name guest=QEMUGuest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,usb=off,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
 -accel tcg \
+-cpu qemu64 \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 2,sockets=2,cores=1,threads=1 \
--object iothread,id=iothread2 \
--object iothread,id=iothread4 \
+-object '{"qom-type":"iothread","id":"iothread5"}' \
+-object '{"qom-type":"iothread","id":"iothread6"}' \
+-object '{"qom-type":"iothread","id":"iothread1"}' \
+-object '{"qom-type":"iothread","id":"iothread2"}' \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \
@@ -27,9 +31,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
--usb \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index 25069acf80d0180b33df8522580801cc7ed37e88..ff759f2ce23aae890e542caa57e10bc74503c153 100644 (file)
@@ -10,7 +10,7 @@
     <iothread id='6'/>
   </iothreadids>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -18,7 +18,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
similarity index 58%
rename from tests/qemuxml2argvdata/iothreads-ids-partial.args
rename to tests/qemuxml2argvdata/iothreads-ids.x86_64-latest.args
index a20f6e68bfb64e3c3879b15698d81fb42a727b6c..dd4280ad967d8a76d2c31a630bb905c71561d107 100644 (file)
@@ -6,19 +6,19 @@ LOGNAME=test \
 XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
 XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
 XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-/usr/bin/qemu-system-i386 \
+/usr/bin/qemu-system-x86_64 \
 -name guest=QEMUGuest1,debug-threads=on \
 -S \
--object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,usb=off,dump-guest-core=off \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram \
 -accel tcg \
+-cpu qemu64 \
 -m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
 -overcommit mem-lock=off \
 -smp 2,sockets=2,cores=1,threads=1 \
--object iothread,id=iothread5 \
--object iothread,id=iothread6 \
--object iothread,id=iothread1 \
--object iothread,id=iothread2 \
+-object '{"qom-type":"iothread","id":"iothread2"}' \
+-object '{"qom-type":"iothread","id":"iothread4"}' \
 -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
 -display none \
 -no-user-config \
@@ -29,9 +29,10 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
--usb \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
 -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
--device ide-hd,bus=ide.0,unit=0,drive=libvirt-1-format,id=ide0-0-0,bootindex=1 \
+-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
index d41a07efa5ccd206d4a7bc33ea231dbb8ae1446f..aca3d7dece46fd7f25fa219a6fe134d5364df38b 100644 (file)
@@ -10,7 +10,7 @@
     <iothread id='4'/>
   </iothreadids>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>hvm</type>
     <boot dev='hd'/>
   </os>
   <clock offset='utc'/>
@@ -18,7 +18,7 @@
   <on_reboot>restart</on_reboot>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
index 851e69fd04410ec3d7442a0a93954316bea5e608..b4ade508cc6c4fbb950b85f8626abb1541c40e18 100644 (file)
@@ -1874,10 +1874,10 @@ mymain(void)
     DO_TEST_NOCAPS("smp");
     DO_TEST("smp-dies", QEMU_CAPS_SMP_DIES);
 
-    DO_TEST("iothreads-ids", QEMU_CAPS_OBJECT_IOTHREAD);
-    DO_TEST("iothreads-ids-partial", QEMU_CAPS_OBJECT_IOTHREAD);
+    DO_TEST_CAPS_LATEST("iothreads-ids");
+    DO_TEST_CAPS_LATEST("iothreads-ids-partial");
     DO_TEST_CAPS_LATEST("iothreads-ids-pool-sizes");
-    DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD);
+    DO_TEST_CAPS_LATEST("iothreads-disk");
     DO_TEST_CAPS_ARCH_VER("iothreads-disk-virtio-ccw", "s390x", "4.2.0");
     DO_TEST_CAPS_VER("iothreads-virtio-scsi-pci", "5.2.0");
     DO_TEST_CAPS_LATEST("iothreads-virtio-scsi-pci");
similarity index 86%
rename from tests/qemuxml2xmloutdata/iothreads-disk.xml
rename to tests/qemuxml2xmloutdata/iothreads-disk.x86_64-latest.xml
index 38074b4c62a7065ce256a8f8da8ac9984407a269..2155971ef0dc37ab87cf6c98b4173061ecfc9283 100644 (file)
@@ -6,15 +6,18 @@
   <vcpu placement='static'>2</vcpu>
   <iothreads>2</iothreads>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>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>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
@@ -33,7 +36,7 @@
       <target dev='vdc' bus='virtio'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 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='ide' index='0'>
similarity index 82%
rename from tests/qemuxml2xmloutdata/iothreads-ids-partial.xml
rename to tests/qemuxml2xmloutdata/iothreads-ids-partial.x86_64-latest.xml
index b6afcf9cbba4ec0cdf2aadf72f305e95459febad..c40bac66435e43f0ee7c2ef056d9f59a578d2e24 100644 (file)
     <iothread id='2'/>
   </iothreadids>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>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>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='hda' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </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='ide' index='0'>
similarity index 82%
rename from tests/qemuxml2xmloutdata/iothreads-ids.xml
rename to tests/qemuxml2xmloutdata/iothreads-ids.x86_64-latest.xml
index 4f734315815616ec50a08380cde806014d924aca..4b55b08ac4a019f4d11b36e4b1418c4d7a5aaad0 100644 (file)
     <iothread id='4'/>
   </iothreadids>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
+    <type arch='x86_64' machine='pc'>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>
   <on_crash>destroy</on_crash>
   <devices>
-    <emulator>/usr/bin/qemu-system-i386</emulator>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <disk type='block' device='disk'>
       <driver name='qemu' type='raw'/>
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='hda' bus='ide'/>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </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='ide' index='0'>
index e8e9091ee4f781db171e6d992549981cb2576885..357d91a4802965b9496c6935b68ecfcfab34dd78 100644 (file)
@@ -572,11 +572,11 @@ mymain(void)
     DO_TEST_CAPS_LATEST("numavcpus-topology-mismatch");
 
     DO_TEST_NOCAPS("smp");
-    DO_TEST_NOCAPS("iothreads-ids");
+    DO_TEST_CAPS_LATEST("iothreads-ids");
     DO_TEST_CAPS_LATEST("iothreads-ids-pool-sizes");
-    DO_TEST_NOCAPS("iothreads-ids-partial");
+    DO_TEST_CAPS_LATEST("iothreads-ids-partial");
     DO_TEST_NOCAPS("cputune-iothreads");
-    DO_TEST_NOCAPS("iothreads-disk");
+    DO_TEST_CAPS_LATEST("iothreads-disk");
     DO_TEST_NOCAPS("iothreads-disk-virtio-ccw");
     DO_TEST("iothreads-virtio-scsi-pci",
             QEMU_CAPS_VIRTIO_SCSI);