]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1697: only check machine type for pxe
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 13 Apr 2018 09:59:08 +0000 (11:59 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 13 Apr 2018 12:41:10 +0000 (14:41 +0200)
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>
PVE/QemuServer.pm

index 54e2e662260517a38c0267c56ca37ef6f2181061..7e531b0c4d98a1dfbe4a0594db01cafc7c329a6d 100644 (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;