[pve-devel] [PATCH qemu-server 02/22] cfg2cmd: require at least QEMU binary version 6.0

Fiona Ebner f.ebner at proxmox.com
Thu Jun 12 16:02:33 CEST 2025


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 at proxmox.com>
---
 PVE/QemuServer.pm          | 15 ++++++---------
 test/cfg2cmd/old-qemu.conf |  4 ++--
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bf0c8bfe..58a5cfa8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1443,7 +1443,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);
 
@@ -1508,7 +1508,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 {
@@ -3478,9 +3478,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);
@@ -3960,8 +3960,7 @@ 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);
@@ -4334,9 +4333,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/test/cfg2cmd/old-qemu.conf b/test/cfg2cmd/old-qemu.conf
index e8129cf6..e560cac7 100644
--- a/test/cfg2cmd/old-qemu.conf
+++ b/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





More information about the pve-devel mailing list