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 C67A91FF09C for ; Mon, 05 Oct 2026 16:37:51 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C92CE21731; Mon, 05 Oct 2026 16:37:25 +0200 (CEST) Message-ID: <5ec8f4d1-11fa-47dd-bee9-6340ada262a0@proxmox.com> Date: Mon, 5 Oct 2026 16:37:19 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 pve-storage 1/16] plugin: add efi-firmware content type To: Christian Ludwig , pve-devel@lists.proxmox.com References: Content-Language: en-US From: Fiona Ebner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791211039289 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.467 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: UNFE3QIYXHT6L5Y4RMVFWAXP32GRE26X X-Message-ID-Hash: UNFE3QIYXHT6L5Y4RMVFWAXP32GRE26X 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:48 AM schrieb Christian Ludwig: > Holds custom OVMF code images in the efi-firmware/ subdirectory of a > storage. File names are restricted to the safe character class. > > Signed-off-by: Christian Ludwig > --- > src/PVE/Storage/Plugin.pm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm > index 4f69f9b..f6ca140 100644 > --- a/src/PVE/Storage/Plugin.pm > +++ b/src/PVE/Storage/Plugin.pm > @@ -372,7 +372,7 @@ PVE::JSONSchema::register_format('pve-storage-content', \&verify_content); > sub verify_content { > my ($ct, $noerr) = @_; > > - return $ct if $ct eq 'import'; > + return $ct if $ct eq 'import' || $ct eq 'efi-firmware'; > > my $valid_content = valid_content_types('dir'); # dir includes all other types > > @@ -831,6 +831,8 @@ sub parse_volname { > m!^import/(${PVE::Storage::SAFE_CHAR_WITH_WHITESPACE_CLASS_RE}+$PVE::Storage::IMPORT_EXT_RE_1)$! See my reply to the cover letter regarding format extensions. > ) { > return ('import', $1, undef, undef, undef, undef, $2); > + } elsif ($volname =~ m!^efi-firmware/(${PVE::Storage::SAFE_CHAR_CLASS_RE}+)$!) { > + return ('efi-firmware', $1, undef, undef, undef, undef, 'raw'); > } > > die "unable to parse directory volume name '$volname'\n"; > @@ -844,6 +846,7 @@ my $vtype_subdirs = { > backup => 'dump', > snippets => 'snippets', > import => 'import', > + 'efi-firmware' => 'efi-firmware', > }; > > sub get_vtype_subdirs { > @@ -1753,6 +1756,10 @@ my $get_subdir_files = sub { > m!/(${PVE::Storage::SAFE_CHAR_CLASS_RE}+$PVE::Storage::IMPORT_EXT_RE_1)$!i; > > $info = { volid => "$sid:import/$1", format => "$2" }; > + } elsif ($tt eq 'efi-firmware') { > + next if $fn !~ m!/(${PVE::Storage::SAFE_CHAR_CLASS_RE}+)$!i; Similarly here, if we go with requiring a specific extension. > + > + $info = { volid => "$sid:efi-firmware/$1", format => 'raw' }; > } > > $info->{size} = $st->size; > @@ -1789,6 +1796,8 @@ sub list_volumes { > $data = $get_subdir_files->($storeid, $path, 'snippets'); > } elsif ($type eq 'import') { > $data = $get_subdir_files->($storeid, $path, 'import'); > + } elsif ($type eq 'efi-firmware' && !defined($vmid)) { > + $data = $get_subdir_files->($storeid, $path, 'efi-firmware'); > } > } > In volume_{export,import}{,_formats}(), the new content type could also be added to allow moving such images between nodes. Should be a separate patch. There's two hunks in patch 4/16 that should already be in this patch, where the content type is introduced. Please also add handling to path_to_volume_id() and complete_content_type() in Storage.pm for completeness. And while there won't be a usage site yet, it seems like it might also make sense to cover in template_list(), because it behaves similarly to 'iso'? Best Regards, Fiona