From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 2BF081FF0A7 for ; Mon, 17 Aug 2026 14:01:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3BF3823DAD; Mon, 17 Aug 2026 14:00:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=genua.de; s=202307; t=1786967973; bh=EvUYyhsnZJfWp+v6Uba22KxqeCfMf3OrM/gGvakZfSg=; h=Date:From:To:Subject:References:In-Reply-To:From; b=h14QLahDG6izuHWT4gVapiP2FGXooFXNO7/wL355VlKqWD5xh+qhyRWVnY5OEBqfd eaIriuhMNVYumi/FKZzFbR5jQFT6KcO9bFXlumWYEa/BlNmRebc6tvLktDK5lNCtVJ rNDJThN0psBYKb1FV3QY4RyP/p8jfPM5RFjk6BYMvpKGppJb746cbpVK7E0gQ6Rbnz fNDIsakOe3JZKKoRZiITjcdGua/+ggAkcaVHz0Lc2CUMigFKzD/2f+X78b1e+qrEGG UERNk/fO1qgpT3MBkQGmK9UkQVkB7I+Mpw9Ci90zHT7jNzQPQ+h5YO1A43VmUc/P2I PAn25ByrGFYHw== Date: Mon, 17 Aug 2026 13:59:32 +0200 From: Christian Ludwig To: Subject: [PATCH qemu-server 09/13] Generate efi-firmware Qemu command line Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [192.168.217.185] X-ClientProxiedBy: kch1-mta09.win.genua.de (10.208.16.109) To kch1-mta07.win.genua.de (10.208.16.107) Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="----7DC8CF1209CB3498FB9B286695F84ED7" X-SPAM-LEVEL: Spam detection results: 0 AWL 0.147 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record UNPARSEABLE_RELAY 0.001 Informational: message has unparseable relay lines Message-ID-Hash: GPQCQZTKGBP7I6BDDCXOAFGLRR3T5VMO X-Message-ID-Hash: GPQCQZTKGBP7I6BDDCXOAFGLRR3T5VMO X-MailFrom: christian_ludwig@genua.de 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-Content-Filtered-By: Mailman/MimeDel 3.3.10 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ------7DC8CF1209CB3498FB9B286695F84ED7 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline If efi-firmware is set, use the correct EFI code file to create the Qemu command line. 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); + 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 ------7DC8CF1209CB3498FB9B286695F84ED7--