[pve-devel] [PATCH qemu-server 1/1] pxe: Fix machine types with pxe

Luca Berneking luca at berneking.net
Thu Mar 25 19:12:03 CET 2021


Fixes a problem with custom pxe roms.
I need to boot a custom ipxe rom image in my pve vms.
I simply replaced the rom file in `/usr/share/kvm/pxe-virtio.rom`
with my custom rom build.
But to actually load these rom images in a new vm, you need to use a
machine type with a ".pxe" suffix. Theres the problem, proxmox adds
"+pve0" to the machine type specified in the config, so
"pc-i440fx-5.0+pve0.pxe" became "pc-i440fx-5.0+pve0.pxe+pve0" which
obviously does not exists and failes to boot.

Signed-off-by: Luca Berneking <luca at berneking.net>
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a498444..85b9fc8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2872,7 +2872,7 @@ sub get_vm_machine {
 	}
     }
 
-    if ($add_pve_version && $machine !~ m/\+pve\d+$/) {
+    if ($add_pve_version && $machine !~ m/\+pve\d+(.pxe)?$/) {
 	# for version-pinned machines that do not include a pve-version (e.g.
 	# pc-q35-4.1), we assume 0 to keep them stable in case we bump
 	$machine .= '+pve0';
-- 
2.31.0





More information about the pve-devel mailing list