[PATCH 04/21] qemuxml2argvtest: Modernize the rest of 'iohtreads-*'

Peter Krempa pkrempa at redhat.com
Thu Mar 2 14:37:46 UTC 2023


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 at redhat.com>
---
 ...args => iothreads-disk.x86_64-latest.args} | 21 +++++++++++--------
 tests/qemuxml2argvdata/iothreads-disk.xml     |  4 ++--
 ... iothreads-ids-partial.x86_64-latest.args} | 19 ++++++++++-------
 .../iothreads-ids-partial.xml                 |  4 ++--
 ....args => iothreads-ids.x86_64-latest.args} | 19 +++++++++--------
 tests/qemuxml2argvdata/iothreads-ids.xml      |  4 ++--
 tests/qemuxml2argvtest.c                      |  6 +++---
 ...k.xml => iothreads-disk.x86_64-latest.xml} |  9 +++++---
 ...> iothreads-ids-partial.x86_64-latest.xml} |  9 +++++---
 ...ds.xml => iothreads-ids.x86_64-latest.xml} |  9 +++++---
 tests/qemuxml2xmltest.c                       |  6 +++---
 11 files changed, 64 insertions(+), 46 deletions(-)
 rename tests/qemuxml2argvdata/{iothreads-disk.args => iothreads-disk.x86_64-latest.args} (60%)
 rename tests/qemuxml2argvdata/{iothreads-ids.args => iothreads-ids-partial.x86_64-latest.args} (54%)
 rename tests/qemuxml2argvdata/{iothreads-ids-partial.args => iothreads-ids.x86_64-latest.args} (58%)
 rename tests/qemuxml2xmloutdata/{iothreads-disk.xml => iothreads-disk.x86_64-latest.xml} (86%)
 rename tests/qemuxml2xmloutdata/{iothreads-ids-partial.xml => iothreads-ids-partial.x86_64-latest.xml} (82%)
 rename tests/qemuxml2xmloutdata/{iothreads-ids.xml => iothreads-ids.x86_64-latest.xml} (82%)

diff --git a/tests/qemuxml2argvdata/iothreads-disk.args b/tests/qemuxml2argvdata/iothreads-disk.x86_64-latest.args
similarity index 60%
rename from tests/qemuxml2argvdata/iothreads-disk.args
rename to tests/qemuxml2argvdata/iothreads-disk.x86_64-latest.args
index ef80cf4008..1f18c97c97 100644
--- a/tests/qemuxml2argvdata/iothreads-disk.args
+++ b/tests/qemuxml2argvdata/iothreads-disk.x86_64-latest.args
@@ -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
diff --git a/tests/qemuxml2argvdata/iothreads-disk.xml b/tests/qemuxml2argvdata/iothreads-disk.xml
index bbfac34db5..485ae3760e 100644
--- a/tests/qemuxml2argvdata/iothreads-disk.xml
+++ b/tests/qemuxml2argvdata/iothreads-disk.xml
@@ -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'/>
diff --git a/tests/qemuxml2argvdata/iothreads-ids.args b/tests/qemuxml2argvdata/iothreads-ids-partial.x86_64-latest.args
similarity index 54%
rename from tests/qemuxml2argvdata/iothreads-ids.args
rename to tests/qemuxml2argvdata/iothreads-ids-partial.x86_64-latest.args
index ddb79f9bef..857e343f8d 100644
--- a/tests/qemuxml2argvdata/iothreads-ids.args
+++ b/tests/qemuxml2argvdata/iothreads-ids-partial.x86_64-latest.args
@@ -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
diff --git a/tests/qemuxml2argvdata/iothreads-ids-partial.xml b/tests/qemuxml2argvdata/iothreads-ids-partial.xml
index 25069acf80..ff759f2ce2 100644
--- a/tests/qemuxml2argvdata/iothreads-ids-partial.xml
+++ b/tests/qemuxml2argvdata/iothreads-ids-partial.xml
@@ -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'/>
diff --git a/tests/qemuxml2argvdata/iothreads-ids-partial.args b/tests/qemuxml2argvdata/iothreads-ids.x86_64-latest.args
similarity index 58%
rename from tests/qemuxml2argvdata/iothreads-ids-partial.args
rename to tests/qemuxml2argvdata/iothreads-ids.x86_64-latest.args
index a20f6e68bf..dd4280ad96 100644
--- a/tests/qemuxml2argvdata/iothreads-ids-partial.args
+++ b/tests/qemuxml2argvdata/iothreads-ids.x86_64-latest.args
@@ -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
diff --git a/tests/qemuxml2argvdata/iothreads-ids.xml b/tests/qemuxml2argvdata/iothreads-ids.xml
index d41a07efa5..aca3d7dece 100644
--- a/tests/qemuxml2argvdata/iothreads-ids.xml
+++ b/tests/qemuxml2argvdata/iothreads-ids.xml
@@ -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'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5db882a142..8dc21ea51e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1883,10 +1883,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");
diff --git a/tests/qemuxml2xmloutdata/iothreads-disk.xml b/tests/qemuxml2xmloutdata/iothreads-disk.x86_64-latest.xml
similarity index 86%
rename from tests/qemuxml2xmloutdata/iothreads-disk.xml
rename to tests/qemuxml2xmloutdata/iothreads-disk.x86_64-latest.xml
index 38074b4c62..2155971ef0 100644
--- a/tests/qemuxml2xmloutdata/iothreads-disk.xml
+++ b/tests/qemuxml2xmloutdata/iothreads-disk.x86_64-latest.xml
@@ -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'>
diff --git a/tests/qemuxml2xmloutdata/iothreads-ids-partial.xml b/tests/qemuxml2xmloutdata/iothreads-ids-partial.x86_64-latest.xml
similarity index 82%
rename from tests/qemuxml2xmloutdata/iothreads-ids-partial.xml
rename to tests/qemuxml2xmloutdata/iothreads-ids-partial.x86_64-latest.xml
index b6afcf9cbb..c40bac6643 100644
--- a/tests/qemuxml2xmloutdata/iothreads-ids-partial.xml
+++ b/tests/qemuxml2xmloutdata/iothreads-ids-partial.x86_64-latest.xml
@@ -12,22 +12,25 @@
     <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'>
diff --git a/tests/qemuxml2xmloutdata/iothreads-ids.xml b/tests/qemuxml2xmloutdata/iothreads-ids.x86_64-latest.xml
similarity index 82%
rename from tests/qemuxml2xmloutdata/iothreads-ids.xml
rename to tests/qemuxml2xmloutdata/iothreads-ids.x86_64-latest.xml
index 4f73431581..4b55b08ac4 100644
--- a/tests/qemuxml2xmloutdata/iothreads-ids.xml
+++ b/tests/qemuxml2xmloutdata/iothreads-ids.x86_64-latest.xml
@@ -10,22 +10,25 @@
     <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'>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 676a707f44..4d9c6853a7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -582,11 +582,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);
-- 
2.39.2



More information about the libvir-list mailing list