[pve-devel] [PATCH qemu-server] fix #1697: only check machine type for pxe

Dominik Csapak d.csapak at proxmox.com
Fri Apr 13 11:59:08 CEST 2018


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 at 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





More information about the pve-devel mailing list