my $devices = [];
my $pciaddr = '';
my $bridges = {};
- my $vernum = 0; # unknown
my $ostype = $conf->{ostype};
my $winversion = windows_version($ostype);
my $kvm = $conf->{kvm};
my $kvm_binary = get_command_for_arch($arch);
my $kvmver = kvm_user_version($kvm_binary);
+ if (!$kvmver || $kvmver !~ m/^(\d+)\.(\d+)/ || $1 < 3) {
+ $kvmver //= "undefined";
+ die "Detected old QEMU binary ('$kvmver', at least 3.0 is required)\n";
+ }
+
my $add_pve_version = min_version($kvmver, 4, 1);
my $machine_type = get_vm_machine($conf, $forcemachine, $arch, $add_pve_version);
if !defined kvm_version();
}
- if ($kvmver =~ m/^(\d+)\.(\d+)$/) {
- $vernum = $1*1000000+$2*1000;
- } elsif ($kvmver =~ m/^(\d+)\.(\d+)\.(\d+)$/) {
- $vernum = $1*1000000+$2*1000+$3;
- }
-
- die "detected old qemu-kvm binary ($kvmver)\n" if $vernum < 15000;
-
my $q35 = PVE::QemuServer::Machine::machine_type_is_q35($conf);
my $hotplug_features = parse_hotplug_features(defined($conf->{hotplug}) ? $conf->{hotplug} : '1');
my $use_old_bios_files = undef;
--- /dev/null
+# TEST: Test QEMU version detection and expect fail on old version
+# QEMU_VERSION: 2.12.1
+# EXPECT_ERROR: Detected old QEMU binary ('2.12.1', at least 3.0 is required)
+smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465