qemuBuildDeviceVideoCmd: Always assume support for 'max_outputs' property

Both the QXL video device and 'virtio' video device support
'max_outputs' in all qemu versions libvirt supports. This means we no
longer have to check the QEMU_CAPS_QXL_MAX_OUTPUTS and
QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-01-18 16:19:03 +01:00
parent 6622e3cc33
commit d35ddc6243
27 changed files with 36 additions and 39 deletions

View File

@ -4869,12 +4869,10 @@ qemuBuildDeviceVideoCmd(virCommand *cmd,
return -1;
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_MAX_OUTPUTS)) {
if (virJSONValueObjectAdd(&props,
"p:max_outputs", video->heads,
NULL) < 0)
return -1;
}
if (virJSONValueObjectAdd(&props,
"p:max_outputs", video->heads,
NULL) < 0)
return -1;
} else if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) {
g_autofree char *alias = qemuDomainGetVhostUserChrAlias(video->info.alias);
@ -4886,8 +4884,7 @@ qemuBuildDeviceVideoCmd(virCommand *cmd,
} else if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
unsigned int heads = 0;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS))
heads = video->heads;
heads = video->heads;
if (virJSONValueObjectAdd(&props,
"p:max_outputs", heads,

View File

@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \
-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
-device ioh3420,port=16,chassis=3,id=pci.3,bus=pcie.0,addr=0x2 \
-vnc 127.0.0.1:0 \
-device virtio-gpu-pci,id=video0,bus=pci.2,addr=0x1 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.2,addr=0x1 \
-msg timestamp=on

View File

@ -31,5 +31,5 @@ QEMU_AUDIO_DRV=none \
-device ioh3420,port=9,chassis=2,id=pci.2,bus=pcie.0,multifunction=on,addr=0x1.0x1 \
-netdev user,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:73:34:53,bootindex=1,bus=pci.1,addr=0x0 \
-device virtio-gpu-pci,id=video0,bus=pci.2,addr=0x0 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.2,addr=0x0 \
-msg timestamp=on

View File

@ -30,5 +30,5 @@ QEMU_AUDIO_DRV=none \
-device ioh3420,port=26,chassis=40,id=pci.2,bus=pcie.0,addr=0x2.0x1 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -38,5 +38,5 @@ QEMU_AUDIO_DRV=none \
-device xio3130-downstream,port=6,chassis=10,id=pci.10,bus=pci.2,addr=0x6 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -32,5 +32,5 @@ QEMU_AUDIO_DRV=none \
-device x3130-upstream,id=pci.4,bus=pci.2,addr=0x0 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -29,5 +29,5 @@ QEMU_AUDIO_DRV=none \
-global q35-pcihost.pci-hole64-size=1048576K \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -55,7 +55,7 @@ QEMU_AUDIO_DRV=none \
-device virtio-mouse-pci,id=input1,bus=pci.11,addr=0x0 \
-device virtio-keyboard-pci,id=input2,bus=pci.12,addr=0x0 \
-device virtio-tablet-pci,id=input3,bus=pci.13,addr=0x0 \
-device virtio-gpu-pci,id=video0,bus=pcie.0,addr=0x1 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.8,addr=0x0 \
-object rng-random,id=objrng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.9,addr=0x0 \

View File

@ -56,7 +56,7 @@ QEMU_AUDIO_DRV=none \
-device virtio-mouse-pci,id=input1,bus=pci.13,addr=0x0 \
-device virtio-keyboard-pci,id=input2,bus=pci.14,addr=0x0 \
-device virtio-tablet-pci,id=input3,bus=pci.15,addr=0x0 \
-device virtio-gpu-pci,id=video0,bus=pcie.0,addr=0x1 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.10,addr=0x0 \
-object rng-random,id=objrng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.11,addr=0x0 \

View File

@ -42,5 +42,5 @@ QEMU_AUDIO_DRV=none \
-device ich9-usb-uhci3,masterbus=usb2.0,firstport=4,bus=pci.2,addr=0x1.0x2 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -42,5 +42,5 @@ QEMU_AUDIO_DRV=none \
-device ich9-usb-uhci1,masterbus=usb2.0,firstport=0,bus=pci.2,multifunction=on,addr=0x1 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -34,5 +34,5 @@ QEMU_AUDIO_DRV=none \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -47,7 +47,7 @@ QEMU_AUDIO_DRV=spice \
-device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-spice port=5901,tls-port=5902,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,image-compression=off,seamless-migration=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pcie.0,addr=0x1 \
-device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b \
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
-chardev spicevmc,id=charredir0,name=usbredir \

View File

@ -56,7 +56,7 @@ QEMU_AUDIO_DRV=none \
-device virtio-mouse-pci,id=input1,bus=pci.2,addr=0x9 \
-device virtio-keyboard-pci,id=input2,bus=pci.2,addr=0xa \
-device virtio-tablet-pci,id=input3,bus=pci.2,addr=0xb \
-device virtio-gpu-pci,id=video0,bus=pcie.0,addr=0x1 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pcie.0,addr=0x1 \
-device virtio-balloon-pci,id=balloon0,bus=pci.2,addr=0x6 \
-object rng-random,id=objrng0,filename=/dev/urandom \
-device virtio-rng-pci,rng=objrng0,id=rng0,max-bytes=123,period=1234,bus=pci.2,addr=0x7 \

View File

@ -32,5 +32,5 @@ QEMU_AUDIO_DRV=none \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x1d.0x2 \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-sata0-0-0 \
-device ide-hd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,bus=pcie.0,addr=0x1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=33554432,max_outputs=1,bus=pcie.0,addr=0x1 \
-msg timestamp=on

View File

@ -32,6 +32,6 @@ QEMU_AUDIO_DRV=spice \
-device isa-serial,chardev=charserial0,id=serial0,index=0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \
-spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,seamless-migration=on \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,8 +29,8 @@ QEMU_AUDIO_DRV=none \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-vnc 127.0.0.1:0 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x3 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \
-device qxl,id=video2,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x5 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x3 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x4 \
-device qxl,id=video2,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x5 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8,xres=1280,yres=720,bus=pci.0,addr=0x2 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8,max_outputs=1,xres=1280,yres=720,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x4 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,7 +29,7 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x2 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x2 \
-device qxl,id=video1,ram_size=67108864,vram_size=67108864,max_outputs=1,bus=pci.0,addr=0x4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -28,6 +28,6 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-display sdl,gl=on \
-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -27,7 +27,7 @@ QEMU_AUDIO_DRV=none \
-no-acpi \
-boot strict=on \
-usb \
-device virtio-gpu-pci,id=video0,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video1,bus=pci.0,addr=0x4 \
-device virtio-gpu-pci,id=video0,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video1,max_outputs=1,bus=pci.0,addr=0x4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=spice \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-spice port=0,gl=on,rendernode=/dev/dri/foo,seamless-migration=on \
-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-usb \
-drive file=/var/lib/libvirt/images/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,cache=none \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-device virtio-gpu-pci,id=video0,virgl=on,bus=pci.0,addr=0x2 \
-device virtio-gpu-pci,id=video0,virgl=on,max_outputs=1,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-msg timestamp=on