From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 521B41FF2AD for ; Thu, 4 Jul 2024 13:57:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A10131B51; Thu, 4 Jul 2024 13:57:58 +0200 (CEST) MIME-Version: 1.0 In-Reply-To: <20240531151330.106977-2-f.ebner@proxmox.com> References: <20240531151330.106977-1-f.ebner@proxmox.com> <20240531151330.106977-2-f.ebner@proxmox.com> From: Fabian =?utf-8?q?Gr=C3=BCnbichler?= To: Proxmox VE development discussion Date: Thu, 04 Jul 2024 13:57:20 +0200 Message-ID: <172009424023.180658.14655390664778049236@yuna.proxmox.com> User-Agent: alot/0.10 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.050 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] applied: [PATCH qemu-server 2/2] cfg2cmd: split out helper for vga properties X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 > --- > > 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