5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-24 02:04:10 +03:00

add multi-monitors spice support

add qxl2 (2monitors),qxl3 (3monitors),qxl4 (4monitors) vga type.

For linux, we only need 1 qxl card with more memory

For windows, we need 1 qxl card by monitor

Original Information from spice-mailing
"
You need to specify multiple devices for Windows VMs. This is what
libvirt gives me (via 'virsh domxml-to-native qemu argv DOMAIN_XML'):
<...> -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -device qxl,id=video1,ram_size=67108864,vram_size=33554432 -device qxl,id=video2,ram_size=67108864,vram_size=33554432 -device qxl,id=video3,ram_size=67108864,vram_size=33554432

For Linux VM, just one qxl device is OK but then it's advisable to
increase the available RAM:
<...> -vga qxl -global qxl-vga.ram_size=134217728 -global qxl-vga.vram_size=33554432

If you don't turn off surfaces, then you should increase vram size to
say 64 MB from current default of 32 MB.
"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2013-09-25 15:33:08 +02:00 committed by Dietmar Maurer
parent 990fc5e22e
commit 2fa3151ebd

View File

@ -338,7 +338,7 @@ EODESC
optional => 1,
type => 'string',
description => "Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win8/win7/w2k8, and 'cirrur' for other OS types. Option 'qxl' enables the SPICE display sever. You can also run without any graphic card using a serial devive as terminal.",
enum => [qw(std cirrus vmware qxl serial0 serial1 serial2 serial3)],
enum => [qw(std cirrus vmware qxl serial0 serial1 serial2 serial3 qxl2 qxl3 qxl4)],
},
watchdog => {
optional => 1,
@ -2236,7 +2236,7 @@ sub foreach_volid {
sub vga_conf_has_spice {
my ($vga) = @_;
return $vga && ($vga eq 'qxl');
return $vga && ($vga =~ m/^qxl/);
}
sub config_to_command {
@ -2291,6 +2291,16 @@ sub config_to_command {
push @$devices, '-readconfig', '/usr/share/qemu-server/pve-usb.cfg' if $use_usb2;
my $vga = $conf->{vga};
my $qxlnum = 0;
if (vga_conf_has_spice($vga)) {
$qxlnum = 1;
if($vga =~ m/^qxl(\d+)$/){
$qxlnum = $1;
}
$vga = 'qxl';
}
if (!$vga) {
if ($conf->{ostype} && ($conf->{ostype} eq 'win8' ||
$conf->{ostype} eq 'win7' ||
@ -2475,6 +2485,19 @@ sub config_to_command {
my $spice_port;
if (vga_conf_has_spice($vga)) {
if($qxlnum > 1 && $conf->{ostype} && $conf->{ostype} eq 'l26'){
push @$cmd, '-global', 'qxl-vga.ram_size=134217728';
push @$cmd, '-global', 'qxl-vga.vram_size=67108864';
}
if($qxlnum > 1 && $conf->{ostype} && $conf->{ostype} =~ m/^w/){
for(my $i = 1; $i < $qxlnum; $i++){
my $pciaddr = print_pci_addr("vga$i", $bridges);
push @$cmd, '-device', "qxl,id=vga$i,ram_size=67108864,vram_size=33554432$pciaddr";
}
}
my $pciaddr = print_pci_addr("spice", $bridges);
$spice_port = PVE::Tools::next_unused_port(61000, 61099);
@ -3515,6 +3538,9 @@ sub print_pci_addr {
net3 => { bus => 0, addr => 21 },
net4 => { bus => 0, addr => 22 },
net5 => { bus => 0, addr => 23 },
vga1 => { bus => 0, addr => 24 },
vga2 => { bus => 0, addr => 25 },
vga3 => { bus => 0, addr => 26 },
#addr29 : usb-host (pve-usb.cfg)
'pci.1' => { bus => 0, addr => 30 },
'pci.2' => { bus => 0, addr => 31 },