]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2(argv|xml)test: Modernize 'sound-device' case
authorPeter Krempa <pkrempa@redhat.com>
Tue, 9 May 2023 11:13:19 +0000 (13:13 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 9 May 2023 13:12:03 +0000 (15:12 +0200)
Drop the unnecessary disk definition and use x86_64 emulator.

For 'qemuxml2argvtest' replace the fake-caps invocation by a 4.2.0
version-locked invocation and  add a '_CAPS_LATEST' invocation.

For 'qemuxml2xmltest' convert to use '_CAPS_LATEST' only.

There are no sound-device relevant changes in the output files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/sound-device.x86_64-4.2.0.args [moved from tests/qemuxml2argvdata/sound-device.args with 82% similarity]
tests/qemuxml2argvdata/sound-device.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/sound-device.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/sound-device.x86_64-latest.xml [moved from tests/qemuxml2xmloutdata/sound-device.xml with 83% similarity]
tests/qemuxml2xmltest.c

similarity index 82%
rename from tests/qemuxml2argvdata/sound-device.args
rename to tests/qemuxml2argvdata/sound-device.x86_64-4.2.0.args
index 0a9a3e5ddb13f5f60c97a0ed8effa64a3910c584..121b37ff99d21c3e01a200a4faaefabba29cd007 100644 (file)
@@ -6,12 +6,13 @@ LOGNAME=test \
 XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
 XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
 XDG_CONFIG_HOME=/var/lib/libvirt/qemu/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=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes \
--machine pc,usb=off,dump-guest-core=off \
+-machine pc-i440fx-4.2,usb=off,dump-guest-core=off \
 -accel tcg \
+-cpu qemu64 \
 -m 214 \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
@@ -25,10 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -no-shutdown \
 -no-acpi \
 -boot strict=on \
--usb \
--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 piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -soundhw pcspk \
 -device ES1370,id=sound1,audiodev=audio1,bus=pci.0,addr=0x2 \
@@ -48,4 +46,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
 -device hda-output,id=sound7-codec2,bus=sound7.0,cad=2,audiodev=audio1 \
 -device usb-audio,id=sound8,audiodev=audio1,bus=usb.0,port=1 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x8 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxml2argvdata/sound-device.x86_64-latest.args b/tests/qemuxml2argvdata/sound-device.x86_64-latest.args
new file mode 100644 (file)
index 0000000..3132760
--- /dev/null
@@ -0,0 +1,50 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel tcg \
+-cpu qemu64 \
+-m 214 \
+-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-soundhw pcspk \
+-device '{"driver":"ES1370","id":"sound1","audiodev":"audio1","bus":"pci.0","addr":"0x2"}' \
+-device '{"driver":"sb16","id":"sound2","audiodev":"audio1"}' \
+-device '{"driver":"AC97","id":"sound3","audiodev":"audio1","bus":"pci.0","addr":"0x3"}' \
+-device '{"driver":"intel-hda","id":"sound4","bus":"pci.0","addr":"0x4"}' \
+-device '{"driver":"hda-duplex","id":"sound4-codec0","bus":"sound4.0","cad":0,"audiodev":"audio1"}' \
+-device '{"driver":"intel-hda","id":"sound5","bus":"pci.0","addr":"0x5"}' \
+-device '{"driver":"hda-micro","id":"sound5-codec0","bus":"sound5.0","cad":0,"audiodev":"audio1"}' \
+-device '{"driver":"hda-duplex","id":"sound5-codec1","bus":"sound5.0","cad":1,"audiodev":"audio1"}' \
+-device '{"driver":"hda-output","id":"sound5-codec2","bus":"sound5.0","cad":2,"audiodev":"audio1"}' \
+-device '{"driver":"ich9-intel-hda","id":"sound6","bus":"pci.0","addr":"0x6"}' \
+-device '{"driver":"hda-duplex","id":"sound6-codec0","bus":"sound6.0","cad":0,"audiodev":"audio1"}' \
+-device '{"driver":"ich9-intel-hda","id":"sound7","bus":"pci.0","addr":"0x7"}' \
+-device '{"driver":"hda-micro","id":"sound7-codec0","bus":"sound7.0","cad":0,"audiodev":"audio1"}' \
+-device '{"driver":"hda-duplex","id":"sound7-codec1","bus":"sound7.0","cad":1,"audiodev":"audio1"}' \
+-device '{"driver":"hda-output","id":"sound7-codec2","bus":"sound7.0","cad":2,"audiodev":"audio1"}' \
+-device '{"driver":"usb-audio","id":"sound8","audiodev":"audio1","bus":"usb.0","port":"1"}' \
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x8"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
index b9427f880a52c6db48f2040da2ea46acb8c4fff7..35a60da197c8652b680da418828eaf230913a278 100644 (file)
@@ -5,20 +5,14 @@
   <currentMemory unit='KiB'>219100</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
+    <type arch='x86_64' machine='pc'>hvm</type>
   </os>
   <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>
-    <disk type='block' device='disk'>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
index 755e8fd664f6c8c1b6d4ec7d8a3f737b162b6f8d..3100078b54e998033193819eced493a111652843 100644 (file)
@@ -1691,11 +1691,8 @@ mymain(void)
             QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE);
     DO_TEST_NOCAPS("balloon-device-auto");
     DO_TEST_NOCAPS("balloon-device-period");
-    DO_TEST("sound-device",
-            QEMU_CAPS_HDA_DUPLEX, QEMU_CAPS_HDA_MICRO,
-            QEMU_CAPS_HDA_OUTPUT,
-            QEMU_CAPS_DEVICE_ICH9_INTEL_HDA,
-            QEMU_CAPS_OBJECT_USB_AUDIO);
+    DO_TEST_CAPS_VER("sound-device", "4.2.0");
+    DO_TEST_CAPS_LATEST("sound-device");
     DO_TEST_CAPS_LATEST("fs9p");
     DO_TEST_CAPS_ARCH_LATEST("fs9p-ccw", "s390x");
 
similarity index 83%
rename from tests/qemuxml2xmloutdata/sound-device.xml
rename to tests/qemuxml2xmloutdata/sound-device.x86_64-latest.xml
index 87d9a5524c90f95f0167120f06066c08db7b2c68..89f537bb018e3497b82dc91254e4272ee15d6819 100644 (file)
@@ -5,22 +5,19 @@
   <currentMemory unit='KiB'>219100</currentMemory>
   <vcpu placement='static'>1</vcpu>
   <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>
-    <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'>
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <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 8e9da95efbd8a9eac2da5c3fcbc7c234b556f99f..93202e8e18d34edbe4aac55bb4c69cfee25922d1 100644 (file)
@@ -449,12 +449,7 @@ mymain(void)
     DO_TEST("net-hostdev-vfio", QEMU_CAPS_DEVICE_VFIO_PCI);
     DO_TEST_NOCAPS("net-midonet");
     DO_TEST_NOCAPS("net-openvswitch");
-    DO_TEST("sound-device",
-            QEMU_CAPS_DEVICE_ICH9_INTEL_HDA,
-            QEMU_CAPS_OBJECT_USB_AUDIO,
-            QEMU_CAPS_HDA_MICRO,
-            QEMU_CAPS_HDA_DUPLEX,
-            QEMU_CAPS_HDA_OUTPUT);
+    DO_TEST_CAPS_LATEST("sound-device");
     DO_TEST_NOCAPS("watchdog");
     DO_TEST_CAPS_LATEST("watchdog-q35-multiple");
     DO_TEST("net-bandwidth", QEMU_CAPS_DEVICE_VGA, QEMU_CAPS_VNC);