From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 7A4421FF09C for ; Mon, 05 Oct 2026 16:36:42 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 0780A21690; Mon, 05 Oct 2026 16:36:33 +0200 (CEST) Message-ID: <2050cb96-2dca-4a22-bf3d-9e83eea7217c@proxmox.com> Date: Mon, 5 Oct 2026 16:36:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 qemu-server 09/16] ovmf: use a custom firmware image if configured To: Christian Ludwig , pve-devel@lists.proxmox.com References: <58f144c27c021d87d29fec22718e8a0f50efa0d9.1790337726.git@genua.de> Content-Language: en-US From: Fiona Ebner In-Reply-To: <58f144c27c021d87d29fec22718e8a0f50efa0d9.1790337726.git@genua.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791210988014 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.480 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YKKQQOPRJ5ZQU2SLZKGD2UTCQPI2CW24 X-Message-ID-Hash: YKKQQOPRJ5ZQU2SLZKGD2UTCQPI2CW24 X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 28.09.26 um 7:49 AM schrieb Christian Ludwig: > Replace the system OVMF code image with the configured one, for the > pflash, blockdev and '-bios' variants. Die if the volume does not exist. > I feel like this should be part of patch 07/16. > Signed-off-by: Christian Ludwig > --- > 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); I'd prefer to have it be handled by get_ovmf_files(). > + 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); And then check if file exists inside get_ovmf_files(), to cover all callers. > + } > + > 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) = Best Regards, Fiona