]> git.proxmox.com Git - qemu-server.git/commitdiff
check if QEMU version is recent enough for machine type
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 9 Dec 2019 15:14:10 +0000 (16:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Dec 2019 08:13:33 +0000 (09:13 +0100)
...and show the user a more meaningful error otherwise.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
PVE/QemuServer.pm

index e10461f11ae1f5cb39fc04ed4922deec7858a811..07cd7fe95252bdcb2ffda8ae748933fda28c6ee5 100644 (file)
@@ -3472,6 +3472,10 @@ sub config_to_command {
     my $machine_version = PVE::QemuServer::Machine::extract_version($machine_type, $kvmver);
     $kvm //= 1 if is_native($arch);
 
+    $machine_version =~ m/(\d+)\.(\d+)/;
+    die "QEMU version $kvmver is too old to run machine type $machine_type\n"
+       if !PVE::QemuServer::min_version($kvmver, $1, $2);
+
     if ($kvm) {
        die "KVM virtualisation configured, but not available. Either disable in VM configuration or enable in BIOS.\n"
            if !defined kvm_version();