machine: incorporate pve machine version when pinning windows guests

When creating or updating guests with OS type windows, we want to pin
the machine version to a specific one. Since introduction of that
feature, we never bumped the pve machine version, so this was missing.

Append the pve machine version only if it's not 0 so we don't add that
unnecessarily.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Link: https://lore.proxmox.com/20250404125345.3244659-5-d.csapak@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Dominik Csapak 2025-04-04 14:53:40 +02:00 committed by Thomas Lamprecht
parent 3f589e8c7e
commit 1d4da507b3

View File

@ -200,6 +200,11 @@ sub windows_get_pinned_machine_version {
my $pin_version = $base_version;
if (!defined($base_version) || !can_run_pve_machine_version($base_version, $kvmversion)) {
$pin_version = get_installed_machine_version($kvmversion);
# pin to the current pveX version to make use of most current features if > 0
my $pvever = get_pve_version($pin_version);
if ($pvever > 0) {
$pin_version .= "+pve$pvever";
}
}
if (!$machine || $machine eq 'pc') {
$machine = "pc-i440fx-$pin_version";