From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 0E52D1FF183
	for <inbox@lore.proxmox.com>; Wed, 18 Jun 2025 15:02:25 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id CAA5412351;
	Wed, 18 Jun 2025 15:02:22 +0200 (CEST)
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Date: Wed, 18 Jun 2025 15:01:42 +0200
Message-Id: <20250618130209.90649-6-f.ebner@proxmox.com>
X-Mailer: git-send-email 2.39.5
In-Reply-To: <20250618130209.90649-1-f.ebner@proxmox.com>
References: <20250618130209.90649-1-f.ebner@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.031 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] [PATCH qemu-server v2 05/32] cfg2cmd: require at least
 QEMU binary version 6.0
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

The minimum supported binary version for Proxmox VE 9 is QEMU 10.0, so
there still is more than enough room for eventual regression testing
with older binaries.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

No changes in v2.

 src/PVE/QemuServer.pm          | 21 +++++++--------------
 src/test/cfg2cmd/old-qemu.conf |  4 ++--
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 89dd7065..3960203b 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1529,7 +1529,7 @@ my sub drive_uses_cache_direct {
 }
 
 sub print_drive_commandline_full {
-    my ($storecfg, $vmid, $drive, $live_restore_name, $io_uring) = @_;
+    my ($storecfg, $vmid, $drive, $live_restore_name) = @_;
 
     my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive);
 
@@ -1594,7 +1594,7 @@ sub print_drive_commandline_full {
     $opts .= ",cache=none" if !$drive->{cache} && $cache_direct;
 
     if (!$drive->{aio}) {
-        if ($io_uring && storage_allows_io_uring_default($scfg, $cache_direct)) {
+        if (storage_allows_io_uring_default($scfg, $cache_direct)) {
             # io_uring supports all cache modes
             $opts .= ",aio=io_uring";
         } else {
@@ -3618,9 +3618,9 @@ sub config_to_command {
     my $kvm_binary = PVE::QemuServer::Helpers::get_command_for_arch($arch);
     my $kvmver = kvm_user_version($kvm_binary);
 
-    if (!$kvmver || $kvmver !~ m/^(\d+)\.(\d+)/ || $1 < 5) {
+    if (!$kvmver || $kvmver !~ m/^(\d+)\.(\d+)/ || $1 < 6) {
         $kvmver //= "undefined";
-        die "Detected old QEMU binary ('$kvmver', at least 5.0 is required)\n";
+        die "Detected old QEMU binary ('$kvmver', at least 6.0 is required)\n";
     }
 
     my $machine_type = PVE::QemuServer::Machine::get_vm_machine($conf, $forcemachine, $arch);
@@ -4147,13 +4147,8 @@ sub config_to_command {
                 push @$devices, '-blockdev', $live_restore->{blockdev};
             }
 
-            my $drive_cmd = print_drive_commandline_full(
-                $storecfg,
-                $vmid,
-                $drive,
-                $live_blockdev_name,
-                min_version($kvmver, 6, 0),
-            );
+            my $drive_cmd =
+                print_drive_commandline_full($storecfg, $vmid, $drive, $live_blockdev_name);
 
             # extra protection for templates, but SATA and IDE don't support it..
             $drive_cmd .= ',readonly=on' if drive_is_read_only($conf, $drive);
@@ -4557,9 +4552,7 @@ sub qemu_iothread_del {
 sub qemu_driveadd {
     my ($storecfg, $vmid, $device) = @_;
 
-    my $kvmver = get_running_qemu_version($vmid);
-    my $io_uring = min_version($kvmver, 6, 0);
-    my $drive = print_drive_commandline_full($storecfg, $vmid, $device, undef, $io_uring);
+    my $drive = print_drive_commandline_full($storecfg, $vmid, $device, undef);
     $drive =~ s/\\/\\\\/g;
     my $ret = PVE::QemuServer::Monitor::hmp_cmd($vmid, "drive_add auto \"$drive\"", 60);
 
diff --git a/src/test/cfg2cmd/old-qemu.conf b/src/test/cfg2cmd/old-qemu.conf
index e8129cf6..e560cac7 100644
--- a/src/test/cfg2cmd/old-qemu.conf
+++ b/src/test/cfg2cmd/old-qemu.conf
@@ -1,4 +1,4 @@
 # TEST: Test QEMU version detection and expect fail on old version
-# QEMU_VERSION: 4.0.1
-# EXPECT_ERROR: Detected old QEMU binary ('4.0.1', at least 5.0 is required)
+# QEMU_VERSION: 5.0.1
+# EXPECT_ERROR: Detected old QEMU binary ('5.0.1', at least 6.0 is required)
 smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465
-- 
2.39.5



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