* [pve-devel] [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used @ 2024-05-31 15:13 Fiona Ebner 2024-05-31 15:13 ` [pve-devel] [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties Fiona Ebner 2024-07-04 11:57 ` [pve-devel] applied: [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fabian Grünbichler 0 siblings, 2 replies; 4+ messages in thread From: Fiona Ebner @ 2024-05-31 15:13 UTC (permalink / raw) To: pve-devel [0]: https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/ [1]: https://lore.kernel.org/qemu-devel/usd6hvncbao47zklcb5qlpvjcuk7odryu57f45imxienyltlec@2ujm6g2gr2od/ Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> --- PVE/QemuServer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 5df0c96d..cf593383 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -179,7 +179,7 @@ my $agent_fmt = { my $vga_fmt = { type => { - description => "Select the VGA type.", + description => "Select the VGA type. Using type 'cirrus' is not recommended.", type => 'string', default => 'std', optional => 1, -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties 2024-05-31 15:13 [pve-devel] [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fiona Ebner @ 2024-05-31 15:13 ` Fiona Ebner 2024-07-04 11:57 ` [pve-devel] applied: " Fabian Grünbichler 2024-07-04 11:57 ` [pve-devel] applied: [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fabian Grünbichler 1 sibling, 1 reply; 4+ messages in thread From: Fiona Ebner @ 2024-05-31 15:13 UTC (permalink / raw) To: pve-devel To remove some line bloat from the config_to_command() function. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> --- Original motivation was to prepare for a deprectation warning for display type 'cirrus'. However, it might not get deprecated after all: https://lore.kernel.org/qemu-devel/usd6hvncbao47zklcb5qlpvjcuk7odryu57f45imxienyltlec@2ujm6g2gr2od/ Still, adding the helper doesn't hurt IMHO. PVE/QemuServer.pm | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index cf593383..a1f8adea 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3493,6 +3493,27 @@ my sub print_ovmf_drive_commandlines { return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str); } +my sub get_vga_properties { + my ($conf, $arch, $machine_version, $winversion) = @_; + + my $vga = parse_vga($conf->{vga}); + + my $qxlnum = vga_conf_has_spice($conf->{vga}); + $vga->{type} = 'qxl' if $qxlnum; + + if (!$vga->{type}) { + if ($arch eq 'aarch64') { + $vga->{type} = 'virtio'; + } elsif (min_version($machine_version, 2, 9)) { + $vga->{type} = (!$winversion || $winversion >= 6) ? 'std' : 'cirrus'; + } else { + $vga->{type} = ($winversion >= 6) ? 'std' : 'cirrus'; + } + } + + return ($vga, $qxlnum); +} + sub config_to_command { my ($storecfg, $vmid, $conf, $defaults, $forcemachine, $forcecpu, $live_restore_backing) = @_; @@ -3644,20 +3665,8 @@ sub config_to_command { my @usbcontrollers = PVE::QemuServer::USB::get_usb_controllers( $conf, $bridges, $arch, $machine_type, $machine_version); push @$devices, @usbcontrollers if @usbcontrollers; - my $vga = parse_vga($conf->{vga}); - my $qxlnum = vga_conf_has_spice($conf->{vga}); - $vga->{type} = 'qxl' if $qxlnum; - - if (!$vga->{type}) { - if ($arch eq 'aarch64') { - $vga->{type} = 'virtio'; - } elsif (min_version($machine_version, 2, 9)) { - $vga->{type} = (!$winversion || $winversion >= 6) ? 'std' : 'cirrus'; - } else { - $vga->{type} = ($winversion >= 6) ? 'std' : 'cirrus'; - } - } + my ($vga, $qxlnum) = get_vga_properties($conf, $arch, $machine_version, $winversion); # enable absolute mouse coordinates (needed by vnc) my $tablet = $conf->{tablet}; -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties 2024-05-31 15:13 ` [pve-devel] [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties Fiona Ebner @ 2024-07-04 11:57 ` Fabian Grünbichler 0 siblings, 0 replies; 4+ messages in thread From: Fabian Grünbichler @ 2024-07-04 11:57 UTC (permalink / raw) To: Proxmox VE development discussion Quoting Fiona Ebner (2024-05-31 17:13:30) > To remove some line bloat from the config_to_command() function. > > Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> > --- > > Original motivation was to prepare for a deprectation warning for > display type 'cirrus'. However, it might not get deprecated after > all: > https://lore.kernel.org/qemu-devel/usd6hvncbao47zklcb5qlpvjcuk7odryu57f45imxienyltlec@2ujm6g2gr2od/ > > Still, adding the helper doesn't hurt IMHO. > > PVE/QemuServer.pm | 35 ++++++++++++++++++++++------------- > 1 file changed, 22 insertions(+), 13 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index cf593383..a1f8adea 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -3493,6 +3493,27 @@ my sub print_ovmf_drive_commandlines { > return ("if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code", $var_drive_str); > } > > +my sub get_vga_properties { > + my ($conf, $arch, $machine_version, $winversion) = @_; > + > + my $vga = parse_vga($conf->{vga}); > + > + my $qxlnum = vga_conf_has_spice($conf->{vga}); > + $vga->{type} = 'qxl' if $qxlnum; > + > + if (!$vga->{type}) { > + if ($arch eq 'aarch64') { > + $vga->{type} = 'virtio'; > + } elsif (min_version($machine_version, 2, 9)) { > + $vga->{type} = (!$winversion || $winversion >= 6) ? 'std' : 'cirrus'; > + } else { > + $vga->{type} = ($winversion >= 6) ? 'std' : 'cirrus'; > + } > + } > + > + return ($vga, $qxlnum); > +} > + > sub config_to_command { > my ($storecfg, $vmid, $conf, $defaults, $forcemachine, $forcecpu, > $live_restore_backing) = @_; > @@ -3644,20 +3665,8 @@ sub config_to_command { > my @usbcontrollers = PVE::QemuServer::USB::get_usb_controllers( > $conf, $bridges, $arch, $machine_type, $machine_version); > push @$devices, @usbcontrollers if @usbcontrollers; > - my $vga = parse_vga($conf->{vga}); > > - my $qxlnum = vga_conf_has_spice($conf->{vga}); > - $vga->{type} = 'qxl' if $qxlnum; > - > - if (!$vga->{type}) { > - if ($arch eq 'aarch64') { > - $vga->{type} = 'virtio'; > - } elsif (min_version($machine_version, 2, 9)) { > - $vga->{type} = (!$winversion || $winversion >= 6) ? 'std' : 'cirrus'; > - } else { > - $vga->{type} = ($winversion >= 6) ? 'std' : 'cirrus'; > - } > - } > + my ($vga, $qxlnum) = get_vga_properties($conf, $arch, $machine_version, $winversion); > > # enable absolute mouse coordinates (needed by vnc) > my $tablet = $conf->{tablet}; > -- > 2.39.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used 2024-05-31 15:13 [pve-devel] [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fiona Ebner 2024-05-31 15:13 ` [pve-devel] [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties Fiona Ebner @ 2024-07-04 11:57 ` Fabian Grünbichler 1 sibling, 0 replies; 4+ messages in thread From: Fabian Grünbichler @ 2024-07-04 11:57 UTC (permalink / raw) To: Proxmox VE development discussion Quoting Fiona Ebner (2024-05-31 17:13:29) > [0]: https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/ > [1]: https://lore.kernel.org/qemu-devel/usd6hvncbao47zklcb5qlpvjcuk7odryu57f45imxienyltlec@2ujm6g2gr2od/ > > Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> > --- > PVE/QemuServer.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 5df0c96d..cf593383 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -179,7 +179,7 @@ my $agent_fmt = { > > my $vga_fmt = { > type => { > - description => "Select the VGA type.", > + description => "Select the VGA type. Using type 'cirrus' is not recommended.", > type => 'string', > default => 'std', > optional => 1, > -- > 2.39.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-04 11:57 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-05-31 15:13 [pve-devel] [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fiona Ebner 2024-05-31 15:13 ` [pve-devel] [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties Fiona Ebner 2024-07-04 11:57 ` [pve-devel] applied: " Fabian Grünbichler 2024-07-04 11:57 ` [pve-devel] applied: [PATCH qemu-server 1/2] schema: vga: mention that type 'cirrus' should not be used Fabian Grünbichler
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox