This is meant to hold custom OVMF code files. It is stored in the efi-firmware/ subdirectory of the storage path. There is no restriction on the file name. But stick with the safe character set, basically for safety reasons. 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)$! ) { 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; + + $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'); } } -- 2.34.1