public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 07/10] cfg2cmd: drop superfluous check for QEMU binary version 4.1
Date: Tue, 23 Jul 2024 17:25:45 +0200	[thread overview]
Message-ID: <20240723152548.129832-8-f.ebner@proxmox.com> (raw)
In-Reply-To: <20240723152548.129832-1-f.ebner@proxmox.com>

The minimum supported version for Proxmox VE 8 nodes is QEMU 8.0 and
the beginning of the config_to_command() function already has a check
for at least version 5.0. No other caller of get_vm_machine() passes
in the parameter, so it can be removed from there as well.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 39b33438..5331ec53 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3253,7 +3253,7 @@ sub windows_get_pinned_machine_version {
 }
 
 sub get_vm_machine {
-    my ($conf, $forcemachine, $arch, $add_pve_version) = @_;
+    my ($conf, $forcemachine, $arch) = @_;
 
     my $machine_conf = PVE::QemuServer::Machine::parse_machine($conf->{machine});
     my $machine = $forcemachine || $machine_conf->{type};
@@ -3268,13 +3268,11 @@ sub get_vm_machine {
 	}
 	$arch //= 'x86_64';
 	$machine ||= $default_machines->{$arch};
-	if ($add_pve_version) {
-	    my $pvever = PVE::QemuServer::Machine::get_pve_version($kvmversion);
-	    $machine .= "+pve$pvever";
-	}
+	my $pvever = PVE::QemuServer::Machine::get_pve_version($kvmversion);
+	$machine .= "+pve$pvever";
     }
 
-    if ($add_pve_version && $machine !~ m/\+pve\d+?(?:\.pxe)?$/) {
+    if ($machine !~ m/\+pve\d+?(?:\.pxe)?$/) {
 	my $is_pxe = $machine =~ m/^(.*?)\.pxe$/;
 	$machine = $1 if $is_pxe;
 
@@ -3559,9 +3557,7 @@ sub config_to_command {
 	die "Detected old QEMU binary ('$kvmver', at least 5.0 is required)\n";
     }
 
-    my $add_pve_version = min_version($kvmver, 4, 1);
-
-    my $machine_type = get_vm_machine($conf, $forcemachine, $arch, $add_pve_version);
+    my $machine_type = get_vm_machine($conf, $forcemachine, $arch);
     my $machine_version = extract_version($machine_type, $kvmver);
     $kvm //= 1 if is_native_arch($arch);
 
@@ -4108,10 +4104,8 @@ sub config_to_command {
     push @$machineFlags, 'smm=off' if should_disable_smm($conf, $vga, $machine_type);
 
     my $machine_type_min = $machine_type;
-    if ($add_pve_version) {
-	$machine_type_min =~ s/\+pve\d+$//;
-	$machine_type_min .= "+pve$required_pve_version";
-    }
+    $machine_type_min =~ s/\+pve\d+$//;
+    $machine_type_min .= "+pve$required_pve_version";
     push @$machineFlags, "type=${machine_type_min}";
 
     PVE::QemuServer::Machine::assert_valid_machine_property($conf, $machine_conf);
-- 
2.39.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2024-07-23 15:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 15:25 [pve-devel] [PATCH-SERIES qemu-server] cfg2cmd: bump minimum binary version to 5.0 and test for QEMU machine version instead of binary version Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 01/10] code cleanup: drop unused parameter from get_vm_machine() Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 02/10] test: bump QEMU version in tests for too new machine type and pve version Fiona Ebner
2024-09-06 14:36   ` Daniel Kral
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 03/10] test: cfg2cmd: don't use QEMU binary version less than 4.0 for tests Fiona Ebner
2024-09-06 14:37   ` Daniel Kral
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 04/10] cfg2cmd: require at least QEMU binary version 4.0 Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 05/10] test: cfg2cmd: don't use QEMU binary version less than 5.0 for tests Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 06/10] cfg2cmd: require at least QEMU binary version 5.0 Fiona Ebner
2024-07-23 15:25 ` Fiona Ebner [this message]
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 08/10] test: cfg2cmd: don't use QEMU binary version less than 6.0 for tests Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 09/10] test: cfg2cmd: don't use QEMU binary version less than 7.0 " Fiona Ebner
2024-07-23 15:25 ` [pve-devel] [PATCH qemu-server 10/10] test: cfg2cmd: don't use QEMU binary version less than 8.0 " Fiona Ebner
2024-09-06 14:39   ` Daniel Kral
2024-09-09  7:42     ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240723152548.129832-8-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal