return $conf->{machine} && ($conf->{machine} =~ m/q35/) ? 1 : 0;
}
+# In list context, also returns whether the current machine is deprecated or not.
sub current_from_query_machines {
my ($machines) = @_;
$current = $machine->{name};
# pve-version only exists for the current machine
$current .= "+$machine->{'pve-version'}" if $machine->{'pve-version'};
- return $current;
+ return wantarray ? ($current, $machine->{deprecated} ? 1 : 0) : $current;
}
}
- # fallback to the default machine if current is not supported by qemu
- return $default || 'pc';
+ # fallback to the default machine if current is not supported by qemu - assume never deprecated
+ my $fallback = $default || 'pc';
+ return wantarray ? ($fallback, 0) : $fallback;
}
-# this only works if VM is running
+# This only works if VM is running.
+# In list context, also returns whether the current machine is deprecated or not.
sub get_current_qemu_machine {
my ($vmid) = @_;