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.csa...@proxmox.com>
---
 PVE/QemuServer.pm | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 315073f..7e58e6a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -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;
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to