[pve-devel] [PATCH qemu-server 4/4] check if QEMU version is recent enough for machine type

Stefan Reiter s.reiter at proxmox.com
Mon Dec 9 16:14:10 CET 2019


...and show the user a more meaningful error otherwise.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 4317516..0201d26 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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();
-- 
2.20.1





More information about the pve-devel mailing list