From: Christian Ludwig <christian_ludwig@genua.de>
To: <pve-devel@lists.proxmox.com>
Subject: [PATCH qemu-server 09/13] Generate efi-firmware Qemu command line
Date: Mon, 17 Aug 2026 13:59:32 +0200 [thread overview]
Message-ID: <aoL3pMs4HXUj+09q@pc43.vpn.genua.de> (raw)
In-Reply-To: <e9670c8e-1101-4591-9534-09217632176b@pc43.vpn.genua.de>
[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]
If efi-firmware is set, use the correct EFI code file to create the Qemu
command line.
Signed-off-by: Christian Ludwig <christian_ludwig@genua.de>
---
src/PVE/QemuServer/OVMF.pm | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuServer/OVMF.pm b/src/PVE/QemuServer/OVMF.pm
index 67665c7c..fe301353 100644
--- a/src/PVE/QemuServer/OVMF.pm
+++ b/src/PVE/QemuServer/OVMF.pm
@@ -123,6 +123,9 @@ my sub print_ovmf_drive_commandlines {
if $cvm_type && $cvm_type eq 'tdx';
my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $d, $q35, $cvm_type);
+ if ($conf->{'efi-firmware'}) {
+ $ovmf_code = PVE::Storage::path($storecfg, $conf->{'efi-firmware'});
+ }
my $ovmf_vars_size = file_get_size($ovmf_vars);
my $var_drive_str = "if=pflash,unit=1,id=drive-efidisk0";
@@ -219,6 +222,9 @@ my sub generate_ovmf_blockdev {
if $cvm_type && $cvm_type eq 'snp';
my ($ovmf_code, $ovmf_vars) = get_ovmf_files($arch, $drive, $q35, $cvm_type);
+ if ($conf->{'efi-firmware'}) {
+ $ovmf_code = PVE::Storage::path($storecfg, $conf->{'efi-firmware'});
+ }
my $ovmf_code_blockdev = {
driver => 'raw',
@@ -268,6 +274,12 @@ sub print_ovmf_commandline {
my $cvm_type = $hw_info->{'cvm-type'};
+ if ($conf->{'efi-firmware'}) {
+ my $fw_path = PVE::Storage::path($storecfg, $conf->{'efi-firmware'});
+ die "efi-firmware volume '$conf->{'efi-firmware'}' not found at '$fw_path'\n"
+ if !file_exists($fw_path);
+ }
+
my $cmd = [];
my $machine_flags = [];
@@ -277,7 +289,13 @@ sub print_ovmf_commandline {
"EFI disks are not supported with Confidential Virtual Machines and will be ignored"
);
}
- push $cmd->@*, '-bios', get_ovmf_files($hw_info->{arch}, undef, undef, $cvm_type);
+ my $bios_path;
+ if ($conf->{'efi-firmware'}) {
+ $bios_path = PVE::Storage::path($storecfg, $conf->{'efi-firmware'});
+ } else {
+ ($bios_path) = get_ovmf_files($hw_info->{arch}, undef, undef, $cvm_type);
+ }
+ push $cmd->@*, '-bios', $bios_path;
} else {
if ($version_guard->(10, 0, 0)) { # for the switch to -blockdev
my ($code_blockdev, $vars_blockdev, $throttle_group) =
--
2.34.1
next prev parent reply other threads:[~2026-08-17 12:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 9:29 [PATCH storage/qemu 0/13]: Custom UEFI firmware in PVE Christian Ludwig
2026-08-17 11:59 ` Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 1/13] Add efi-firmware content type Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 2/13] Test for " Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 3/13] Allow efi-firmware in file-based storage Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 4/13] Extend storage API endpoints for efi-firmware Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 5/13] Volume access check test " Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-storage 6/13] efi-firmware storage path to volume conversion test Christian Ludwig
2026-08-17 9:29 ` [PATCH qemu-server 07/13] Add efi-firmware key to VM config schema Christian Ludwig
2026-08-17 9:29 ` [PATCH qemu-server 08/13] Add efi-firmware support to the API Christian Ludwig
2026-08-17 9:29 ` [PATCH qemu-server 09/13] Generate efi-firmware Qemu command line Christian Ludwig
2026-08-17 9:29 ` [PATCH qemu-server 10/13] test: efi-firmware key in VM config Christian Ludwig
2026-08-17 9:29 ` [PATCH qemu-server 11/13] test: efi-firmware volumes replication Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-docs 12/13] pvesm: Document efi-firmware content type Christian Ludwig
2026-08-17 9:29 ` [PATCH pve-docs 13/13] qm: Document efi-firmware VM option Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 1/13] Add efi-firmware content type Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 2/13] Test for " Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 3/13] Allow efi-firmware in file-based storage Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 4/13] Extend storage API endpoints for efi-firmware Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 5/13] Volume access check test " Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-storage 6/13] efi-firmware storage path to volume conversion test Christian Ludwig
2026-08-17 11:59 ` [PATCH qemu-server 07/13] Add efi-firmware key to VM config schema Christian Ludwig
2026-08-17 11:59 ` [PATCH qemu-server 08/13] Add efi-firmware support to the API Christian Ludwig
2026-08-17 11:59 ` Christian Ludwig [this message]
2026-08-17 11:59 ` [PATCH qemu-server 10/13] test: efi-firmware key in VM config Christian Ludwig
2026-08-17 11:59 ` [PATCH qemu-server 11/13] test: efi-firmware volumes replication Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-docs 12/13] pvesm: Document efi-firmware content type Christian Ludwig
2026-08-17 11:59 ` [PATCH pve-docs 13/13] qm: Document efi-firmware VM option Christian Ludwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aoL3pMs4HXUj+09q@pc43.vpn.genua.de \
--to=christian_ludwig@genua.de \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.