print_vga_device: fix qxl displays on Linux guests

with pve-qemu-4.0.1-3 or higher it was not possible in a spice remote
session to enable more displays on the fly in linux guests.

Adding the `max_outputs` parameter to the qxl device manually restores
the functionality.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
Aaron Lauterer 2019-11-19 16:18:19 +01:00 committed by Thomas Lamprecht
parent 9a9ba5f857
commit 6021c7a5ed
2 changed files with 10 additions and 2 deletions

View File

@ -2184,9 +2184,17 @@ sub print_vga_device {
$type = 'virtio-gpu';
}
my $vgamem_mb = $vga->{memory};
my $max_outputs = '';
if ($qxlnum) {
$type = $id ? 'qxl' : 'qxl-vga';
if ($conf->{ostype} =~ m/^l(?=\d)/) {
# set max outputs so linux can have up to 4 qxl displays with one device
$max_outputs = ",max_outputs=4";
}
}
die "no devicetype for $vga->{type}\n" if !$type;
my $memory = "";
@ -2218,7 +2226,7 @@ sub print_vga_device {
$pciaddr = print_pci_addr($vgaid, $bridges, $arch, $machine);
}
return "$type,id=${vgaid}${memory}${pciaddr}";
return "$type,id=${vgaid}${memory}${max_outputs}${pciaddr}";
}
sub drive_is_cloudinit {

View File

@ -21,7 +21,7 @@
-device 'nec-usb-xhci,id=xhci,bus=pci.1,addr=0x1b' \
-chardev 'spicevmc,id=usbredirchardev1,name=usbredir' \
-device 'usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci.0' \
-device 'qxl-vga,id=vga,bus=pci.0,addr=0x2' \
-device 'qxl-vga,id=vga,max_outputs=4,bus=pci.0,addr=0x2' \
-device 'virtio-serial,id=spice,bus=pci.0,addr=0x9' \
-chardev 'spicevmc,id=vdagent,name=vdagent' \
-device 'virtserialport,chardev=vdagent,name=com.redhat.spice.0' \