qemuxml2(argv|xml)test: Modernize 'sound-device' case

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>
This commit is contained in:
Peter Krempa 2023-05-09 13:13:19 +02:00
parent 351504744e
commit d6d4cfa5fc
6 changed files with 66 additions and 34 deletions

View 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

View File

@ -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

View 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'/>

View 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");

View 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'>

View 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);