fix #7525: vga: allow setting the number of outputs for VirtIO GPU

With SPICE and QXL, Linux guests get 'max_outputs=4' on the display
device, so they can use up to four displays with a single device. For
the VirtIO GPU, there is no way to change QEMU's default of a single
output, so using multiple displays requires passing the whole device
via custom arguments.

Add a 'max-outputs' option to the 'vga' property, which sets the
'max_outputs' property of the VirtIO GPU, for both 'virtio' and
'virtio-gl'. QEMU supports up to 16 outputs. Other display types
reject the option, as QXL handles multiple displays on its own.

Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
dualfroz committed 2026-10-03 01:53:20 +02:00
1 parent 1b6f27e716
commit 5f10cfd754
4 files changed
+71

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
# TEST: Test that max-outputs is rejected for non-VirtIO GPUs
# EXPECT_ERROR: 'max-outputs' is only supported with VGA type 'virtio' or 'virtio-gl'
cores: 2
memory: 2048
name: qxldisplays
net0: virtio=A2:C0:43:67:08:A1,bridge=vmbr0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8
vga: qxl,max-outputs=2