fix #1697: only check machine type for pxe

it is not necessary to check the romfile of the running vm
for .pxe machine types, since the machine type itself is not
hot-pluggable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-04-13 11:59:08 +02:00 committed by Wolfgang Bumiller
parent fd950b2385
commit 3807f3e4ee

View File

@ -6464,13 +6464,8 @@ sub qemu_machine_pxe {
$machine = PVE::QemuServer::get_current_qemu_machine($vmid) if !$machine;
foreach my $opt (keys %$conf) {
next if $opt !~ m/^net(\d+)$/;
my $net = PVE::QemuServer::parse_net($conf->{$opt});
next if !$net;
my $romfile = PVE::QemuServer::vm_mon_cmd_nocheck($vmid, 'qom-get', path => $opt, property => 'romfile');
return $machine.".pxe" if $romfile =~ m/pxe/;
last;
if ($conf->{machine} && $conf->{machine} =~ m/\.pxe$/) {
$machine .= '.pxe';
}
return $machine;