From 74cc511fda5301861ac6795fd6fc9faef3f3cae9 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 25 Feb 2016 14:47:16 +0100 Subject: [PATCH] fix undefined value when starting a q35 machine VM As there the signleton function "kvm_user_version" may not have been called and with the machine alias q35 the regex from the qemu_machine_feature_enabled method does not match and thus we need a valid kvm version here --- PVE/QemuServer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6a41d2bf..0fcbead8 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -6647,11 +6647,12 @@ sub qemu_use_old_bios_files { $machine_type = $1; $use_old_bios_files = 1; } else { + my $kvmver = kvm_user_version(); # Note: kvm version < 2.4 use non-efi pxe files, and have problems when we # load new efi bios files on migration. So this hack is required to allow # live migration from qemu-2.2 to qemu-2.4, which is sometimes used when # updrading from proxmox-ve-3.X to proxmox-ve 4.0 - $use_old_bios_files = !qemu_machine_feature_enabled ($machine_type, undef, 2, 4); + $use_old_bios_files = !qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 4); } return ($use_old_bios_files, $machine_type);