From 3f589e8c7e719e3c04ccc4d3deb849d5868735f9 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 4 Apr 2025 14:53:39 +0200 Subject: [PATCH] machine: correctly select pve machine version for non pinned windows guests When we don't have a specific machine version on a windows guest, we use the creation meta info to pin the machine version. Currently we always append the pve machine version from the current installed KVM version, which is not necessarily the version we pinned the guest to. Instead, use the same mechanism as for normal version pinned machines, which use 'pve0'. For non-windows machines, we use the current QEMU machine version so we should use the pve machine version from that too, so that stays the same. Signed-off-by: Dominik Csapak Reviewed-by: Fiona Ebner Reviewed-by: Stoiko Ivanov Tested-By: Stoiko Ivanov Link: https://lore.proxmox.com/20250404125345.3244659-4-d.csapak@proxmox.com Signed-off-by: Thomas Lamprecht --- PVE/QemuServer/Machine.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm index f1acde8f..33f00a59 100644 --- a/PVE/QemuServer/Machine.pm +++ b/PVE/QemuServer/Machine.pm @@ -240,11 +240,12 @@ sub get_vm_machine { } } $machine = windows_get_pinned_machine_version($machine, $base_version, $kvmversion); + } else { + $arch //= 'x86_64'; + $machine ||= default_machine_for_arch($arch); + my $pvever = get_pve_version($kvmversion); + $machine .= "+pve$pvever"; } - $arch //= 'x86_64'; - $machine ||= default_machine_for_arch($arch); - my $pvever = get_pve_version($kvmversion); - $machine .= "+pve$pvever"; } if ($machine !~ m/\+pve\d+?(?:\.pxe)?$/) {