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 AADE81FF0AA for ; Tue, 17 Nov 2026 21:41:02 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7BFCE2168D; Tue, 17 Nov 2026 21:40:50 +0100 (CET) From: "Max R. Carrara" To: pve-devel@lists.proxmox.com Subject: [PATCH pve-storage v3 05/51] plugin api: replace subdir helper methods with standalone functions Date: Tue, 17 Nov 2026 21:38:37 +0100 Message-ID: <20261117203953.913035-6-m.carrara@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261117203953.913035-1-m.carrara@proxmox.com> References: <20261117203953.913035-1-m.carrara@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794948003984 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.274 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: TOY7NZAUZAQ45DX6K7N7GGGVM5ZJJDBB X-Message-ID-Hash: TOY7NZAUZAQ45DX6K7N7GGGVM5ZJJDBB X-MailFrom: m.carrara@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 CC: Wolfgang Bumiller X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Replace the `get_vtype_subdirs()` and `get_subdir()` helpers in PVE::Storage::Plugin with standalone helper subroutines `plugin_get_default_vtype_subdirs()` and `plugin_get_vtype_subdir()` in PVE::Storage::Common. This is mostly to prevent third-party plugins from relying on these helpers as if they were part of the storage plugin API; the signature of `get_subdir()` in particular looks as if it belongs to an API method, even though it is only used as a helper in PVE::Storage, PVE::Storage::Plugin, and PVE::Storage::BTRFSPlugin. Therefore, make it explicit that these subroutines are really just helpers by replacing them with slightly altered versions in PVE::Storage::Common. Add docstrings for these replacements as well. Replace all occurrences of `get_vtype_subdirs()` and `get_subdir()` across the repository with their newly introduced counterparts `plugin_get_default_vtype_subdirs()` and `plugin_get_vtype_subdir()`, where possible. In places where a replacement would be *technically* API-breaking, add a FIXME comment for the next APIAGE reset instead. Additionally, note that PVE::Storage::ESXiPlugin is the only plugin that explicitly overrides `get_subdir()`, treating it as if it were an API method, but because that plugin is not filesystem-based (in the sense that it does not declare the `path` property in its options), calling `get_subdir()` would throw an exception anyhow. Also, it should be mentioned that all methods that could call into `get_subdir()` have been overridden inside ESXiPlugin, too. Therefore, the override of `get_subdir()` in PVE::Storage::ESXiPlugin is superfluous, so remove it. Signed-off-by: Max R. Carrara --- src/PVE/Storage.pm | 15 +++++++++ src/PVE/Storage/BTRFSPlugin.pm | 16 +++++---- src/PVE/Storage/Common.pm | 51 +++++++++++++++++++++++++++++ src/PVE/Storage/ESXiPlugin.pm | 6 ---- src/PVE/Storage/Plugin.pm | 47 +++++++++++++------------- src/test/get_subdir_test.pm | 12 ++++--- src/test/parse_volname_test.pm | 6 +++- src/test/path_to_volume_id_test.pm | 6 +++- src/test/run_volume_access_tests.pl | 5 ++- 9 files changed, 121 insertions(+), 43 deletions(-) diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index 9b8c5284..083bc322 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -530,59 +530,71 @@ sub get_image_dir { my ($cfg, $storeid, $vmid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $path = $plugin->get_subdir($scfg, 'images'); return $vmid ? "$path/$vmid" : $path; } sub get_private_dir { my ($cfg, $storeid, $vmid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $path = $plugin->get_subdir($scfg, 'rootdir'); return $vmid ? "$path/$vmid" : $path; } sub get_iso_dir { my ($cfg, $storeid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. return $plugin->get_subdir($scfg, 'iso'); } sub get_import_dir { my ($cfg, $storeid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. return $plugin->get_subdir($scfg, 'import'); } sub get_vztmpl_dir { my ($cfg, $storeid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. return $plugin->get_subdir($scfg, 'vztmpl'); } sub get_backup_dir { my ($cfg, $storeid) = @_; my $scfg = storage_config($cfg, $storeid); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. return $plugin->get_subdir($scfg, 'backup'); } # library implementation @@ -726,10 +738,13 @@ sub path_to_volume_id { foreach my $sid (keys %$ids) { my $scfg = $ids->{$sid}; next if !$scfg->{path}; my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); + + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $imagedir = $plugin->get_subdir($scfg, 'images'); my $isodir = $plugin->get_subdir($scfg, 'iso'); my $tmpldir = $plugin->get_subdir($scfg, 'vztmpl'); my $backupdir = $plugin->get_subdir($scfg, 'backup'); my $snippetsdir = $plugin->get_subdir($scfg, 'snippets'); diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm index 72cb39b7..1c81b7b8 100644 --- a/src/PVE/Storage/BTRFSPlugin.pm +++ b/src/PVE/Storage/BTRFSPlugin.pm @@ -11,11 +11,13 @@ use File::Path qw(mkpath); use IO::Dir; use POSIX qw(EEXIST); use PVE::Tools qw(run_command dir_glob_foreach); -use PVE::Storage::Common; +use PVE::Storage::Common qw( + plugin_get_vtype_subdir +); use PVE::Storage::DirPlugin; use constant { BTRFS_FIRST_FREE_OBJECTID => 256, FS_NOCOW_FL => 0x00800000, @@ -203,11 +205,11 @@ sub raw_file_to_subvol($) { sub filesystem_path { my ($class, $scfg, $volname, $snapname) = @_; my ($vtype, $name, $vmid, undef, undef, $isBase, $format) = $class->parse_volname($volname); - my $path = $class->get_subdir($scfg, $vtype); + my $path = plugin_get_vtype_subdir($scfg, $vtype); my $is_guest_volume = PVE::Storage::Common::is_guest_vtype($vtype); $path .= "/$vmid" if $is_guest_volume; if ($is_guest_volume && defined($format) && $format eq 'raw') { @@ -310,11 +312,11 @@ sub clone_image { # or a subvolume, we forward to the DirPlugin if ($format ne 'raw' && $format ne 'subvol') { return PVE::Storage::DirPlugin::clone_image(@_); } - my $imagedir = $class->get_subdir($scfg, 'images'); + my $imagedir = plugin_get_vtype_subdir($scfg, 'images'); $imagedir .= "/$vmid"; mkpath $imagedir; my $path = $class->filesystem_path($scfg, $volname); my $newname = $class->find_free_diskname($storeid, $scfg, $vmid, $format, 1); @@ -343,11 +345,11 @@ sub alloc_image { return $class->SUPER::alloc_image($storeid, $scfg, $vmid, $fmt, $name, $size); } # From Plugin.pm: - my $imagedir = $class->get_subdir($scfg, 'images') . "/$vmid"; + my $imagedir = plugin_get_vtype_subdir($scfg, 'images') . "/$vmid"; mkpath $imagedir; $name = $class->find_free_diskname($storeid, $scfg, $vmid, $fmt, 1) if !$name; @@ -661,11 +663,11 @@ sub volume_has_feature { return undef; } sub list_images { my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_; - my $imagedir = $class->get_subdir($scfg, 'images'); + my $imagedir = plugin_get_vtype_subdir($scfg, 'images'); my $res = []; # Copied from Plugin.pm, with file_size_info calls adapted: foreach my $fn (<$imagedir/[0-9][0-9]*/*>) { @@ -862,11 +864,11 @@ sub volume_import { if (!defined($base_snapshot) && -e $destination) { die "volume $volname already exists\n" if !$allow_rename; $volname = $class->find_free_diskname($storeid, $scfg, $vmid, $volume_format, 1); } - my $imagedir = $class->get_subdir($scfg, $vtype); + my $imagedir = plugin_get_vtype_subdir($scfg, $vtype); $imagedir .= "/$vmid" if PVE::Storage::Common::is_guest_vtype($vtype); my $tmppath = "$imagedir/recv.$vmid.tmp"; mkdir($imagedir); # FIXME: if $scfg->{mkdir}; if (!mkdir($tmppath)) { @@ -994,11 +996,11 @@ sub rename_volume { $target_volname = $class->find_free_diskname($storeid, $scfg, $target_vmid, $format, 1) if !$target_volname; $target_volname = $class->volname_for_format($target_volname, $format, 0); $target_volname = "$target_vmid/$target_volname"; - my $basedir = $class->get_subdir($scfg, 'images'); + my $basedir = plugin_get_vtype_subdir($scfg, 'images'); mkpath "${basedir}/${target_vmid}"; my $source_dir = raw_name_to_dir($source_volname); my $target_dir = raw_name_to_dir($target_volname); diff --git a/src/PVE/Storage/Common.pm b/src/PVE/Storage/Common.pm index a784163e..58f2adfa 100644 --- a/src/PVE/Storage/Common.pm +++ b/src/PVE/Storage/Common.pm @@ -21,10 +21,13 @@ our @EXPORT_OK = qw( qemu_img_create qemu_img_create_qcow2_backed qemu_img_info qemu_img_measure qemu_img_resize + + plugin_get_default_vtype_subdirs + plugin_get_vtype_subdir ); use constant { FALLOC_FL_KEEP_SIZE => 0x01, # see linux/falloc.h FALLOC_FL_PUNCH_HOLE => 0x02, # see linux/falloc.h @@ -125,10 +128,21 @@ my $GENERIC_VTYPE = { 'vm-vol' => 'images', 'vm-state' => 'images', 'ct-vol' => 'rootdir', }; +# TODO: vtype split: (possibly) adapt default directories during migration period +my $DEFAULT_VTYPE_SUBDIRS = { + images => 'images', + rootdir => 'private', + iso => 'template/iso', + vztmpl => 'template/cache', + backup => 'dump', + snippets => 'snippets', + import => 'import', +}; + =head1 FUNCTIONS =cut =head3 generic_vtype @@ -379,6 +393,43 @@ sub qemu_img_resize { $timeout = PVE::RPCEnvironment->is_worker() ? 60 * 60 : 10; } run_command($cmd, timeout => $timeout); } +=head3 plugin_get_default_vtype_subdirs + + my $vtype_subdirs = plugin_get_default_vtype_subdirs() + +Returns a hashref containing the default sub-directories for every volume type. + +=cut + +sub plugin_get_default_vtype_subdirs : prototype() () { + return { $DEFAULT_VTYPE_SUBDIRS->%* }; # shallow copy to prevent changes to defaults +} + +=head3 plugin_get_vtype_subdir + + my $subdir = plugin_get_vtype_subdir($scfg, $vtype) + +Returns the sub-directory for the volume type C<$vtype> of a given storage +configuration C<$scfg> as an absolute path. + +Raises an exception if the storage config has no C attribute or +if the given C<$vtype> does not exist. + +=cut + +sub plugin_get_vtype_subdir : prototype($$) ($scfg, $vtype) { + my $path = $scfg->{path}; + + die "storage definition has no path\n" if !$path; + + $vtype = 'images' if is_guest_vtype($vtype); + die "unknown vtype '$vtype'\n" if !exists($DEFAULT_VTYPE_SUBDIRS->{$vtype}); + + my $subdir = $scfg->{"content-dirs"}->{$vtype} // $DEFAULT_VTYPE_SUBDIRS->{$vtype}; + + return "$path/$subdir"; +} + 1; diff --git a/src/PVE/Storage/ESXiPlugin.pm b/src/PVE/Storage/ESXiPlugin.pm index 4c237f76..485e9422 100644 --- a/src/PVE/Storage/ESXiPlugin.pm +++ b/src/PVE/Storage/ESXiPlugin.pm @@ -624,16 +624,10 @@ sub volume_has_feature { return undef if defined($snapname) || $volname =~ /\.vmx$/; return 1 if $feature eq 'copy'; return undef; } -sub get_subdir { - my ($class, $scfg, $vtype) = @_; - - die "no subdirectories available for storage $class\n"; -} - package PVE::Storage::ESXiPlugin::Manifest; use strict; use warnings; diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index 5f25ec51..febef741 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -13,11 +13,14 @@ use File::stat qw(); use PVE::Tools qw(run_command); use PVE::JSONSchema qw(get_standard_option register_standard_option); use PVE::Cluster qw(cfs_register_file); -use PVE::Storage::Common; +use PVE::Storage::Common qw( + plugin_get_default_vtype_subdirs + plugin_get_vtype_subdir +); use JSON; use base qw(PVE::SectionConfig); @@ -1006,37 +1009,20 @@ sub volname_with_format { return $name if !$correct_fmt_ext; return "$name.$correct_fmt_ext"; } -my $vtype_subdirs = { - images => 'images', - rootdir => 'private', - iso => 'template/iso', - vztmpl => 'template/cache', - backup => 'dump', - snippets => 'snippets', - import => 'import', -}; - +# FIXME: remove on the next APIAGE reset. sub get_vtype_subdirs { - return $vtype_subdirs; + return plugin_get_default_vtype_subdirs(); } +# FIXME: remove on the next APIAGE reset. sub get_subdir { my ($class, $scfg, $vtype) = @_; - my $path = $scfg->{path}; - - die "storage definition has no path\n" if !$path; - - $vtype = 'images' if PVE::Storage::Common::is_guest_vtype($vtype); - die "unknown vtype '$vtype'\n" if !exists($vtype_subdirs->{$vtype}); - - my $subdir = $scfg->{"content-dirs"}->{$vtype} // $vtype_subdirs->{$vtype}; - - return "$path/$subdir"; + return plugin_get_vtype_subdir($scfg, $vtype); } my sub get_snap_name { my ($class, $volname, $snapname) = @_; die "missing snapname\n" if !$snapname; @@ -1057,10 +1043,12 @@ sub filesystem_path { # Note: qcow2/qed has internal snapshot, so path is always # the same (with or without snapshot => same file). die "can't snapshot this image format\n" if defined($snapname) && $format !~ m/^(qcow2|qed)$/; + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $dir = $class->get_subdir($scfg, $vtype); $dir .= "/$vmid" if PVE::Storage::Common::is_guest_vtype($vtype); my $path = "$dir/$name"; @@ -1188,10 +1176,12 @@ sub clone_image { die "this storage type does not support clone_image on subvolumes\n" if $format eq 'subvol'; die "clone_image only works on base images\n" if !$isBase; + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $imagedir = $class->get_subdir($scfg, 'images'); $imagedir .= "/$vmid"; mkpath $imagedir; @@ -1221,10 +1211,12 @@ sub clone_image { } sub alloc_image { my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_; + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $imagedir = $class->get_subdir($scfg, 'images'); $imagedir .= "/$vmid"; mkpath $imagedir; @@ -1799,10 +1791,12 @@ sub volume_has_feature { } sub list_images { my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_; + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $imagedir = $class->get_subdir($scfg, 'images'); my $format_info = $class->get_formats($scfg, $storeid); my $fmts = join('|', sort keys $format_info->{valid}->%*); @@ -1950,10 +1944,12 @@ sub list_volumes { my $data; if ($type eq 'images' || $type eq 'rootdir') { $data = $class->list_images($storeid, $scfg, $vmid); } elsif ($scfg->{path}) { + # FIXME: Call plugin_get_vtype_subdir() instead of + # $plugin->get_subdir() on the next APIAGE reset. my $path = $class->get_subdir($scfg, $type); if ($type eq 'iso' && !defined($vmid)) { $data = get_subdir_files($storeid, $path, 'iso'); } elsif ($type eq 'vztmpl' && !defined($vmid)) { @@ -2145,10 +2141,12 @@ sub activate_storage { } my $try_create_subdir = sub { my ($vtype) = @_; + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $subdir = $class->get_subdir($scfg, $vtype); File::Path::make_path($subdir, { error => \my $errors }); if (defined($errors) && scalar($errors->@*)) { my $msg = "failed to create content directory '$subdir' for content '$vtype'"; @@ -2184,24 +2182,27 @@ sub activate_storage { if ( (!defined($scfg->{'create-subdirs'}) || $scfg->{'create-subdirs'}) # FIXME The mkdir option is deprecated. Remove with PVE 9? && (!defined($scfg->{mkdir}) || $scfg->{mkdir}) ) { - for my $vtype (sort keys %$vtype_subdirs) { + my $vtype_subdirs = plugin_get_default_vtype_subdirs(); + for my $vtype (sort keys $vtype_subdirs->%*) { # OpenVZMigrate uses backup (dump) dir if ( defined($dir_vtypes->{$vtype}) || ($vtype eq 'backup' && defined($scfg->{content}->{'rootdir'})) ) { $try_create_subdir->($vtype); } } } # check that content dirs are pairwise inequal my $resolved_subdirs = {}; for my $vtype (sort keys $dir_vtypes->%*) { + # FIXME: Call plugin_get_vtype_subdir() instead of $plugin->get_subdir() + # on the next APIAGE reset. my $subdir = $class->get_subdir($scfg, $vtype); my $abs_subdir = abs_path($subdir); next if !defined($abs_subdir); die "storage '$storeid' uses directory $abs_subdir for multiple content types\n" diff --git a/src/test/get_subdir_test.pm b/src/test/get_subdir_test.pm index 9f7e2266..02d377d5 100644 --- a/src/test/get_subdir_test.pm +++ b/src/test/get_subdir_test.pm @@ -3,20 +3,24 @@ package PVE::Storage::TestGetSubdir; use strict; use warnings; use lib qw(..); +use PVE::Storage::Common qw( + plugin_get_default_vtype_subdirs + plugin_get_vtype_subdir +); use PVE::Storage::Plugin; use Test::More; my $scfg_with_path = { path => '/some/path' }; -my $vtype_subdirs = PVE::Storage::Plugin::get_vtype_subdirs(); +my $vtype_subdirs = plugin_get_default_vtype_subdirs(); # each test is comprised of the following array keys: # [0] => storage config; positive with path key # [1] => storage type; see $vtype_subdirs -# [2] => expected return from get_subdir +# [2] => expected return from plugin_get_vtype_subdir my $tests = [ # failed matches [$scfg_with_path, 'none', "unknown vtype 'none'\n"], [{}, 'iso', "storage definition has no path\n"], ]; @@ -50,14 +54,14 @@ plan tests => scalar @$tests; foreach my $tt (@$tests) { my ($scfg, $type, $expected) = @$tt; my $got; - eval { $got = PVE::Storage::Plugin->get_subdir($scfg, $type) }; + eval { $got = plugin_get_vtype_subdir($scfg, $type) }; $got = $@ if $@; - is($got, $expected, "get_subdir for $type") || diag(explain($got)); + is($got, $expected, "plugin_get_vtype_subdir for $type") || diag(explain($got)); } done_testing(); 1; diff --git a/src/test/parse_volname_test.pm b/src/test/parse_volname_test.pm index 5eb7f55c..a3b4d568 100644 --- a/src/test/parse_volname_test.pm +++ b/src/test/parse_volname_test.pm @@ -4,10 +4,13 @@ use strict; use warnings; use lib qw(..); use PVE::Storage; +use PVE::Storage::Common qw( + plugin_get_default_vtype_subdirs +); use Test::More; my $vmid = 1234; { @@ -593,11 +596,12 @@ push $tests->@*, # run through test case array # plan tests => scalar @$tests + 1; my $seen_vtype; -my $vtype_subdirs = { map { $_ => 1 } keys %{ PVE::Storage::Plugin::get_vtype_subdirs() } }; +my $vtype_subdirs = + { map { $_ => 1 } keys %{ plugin_get_default_vtype_subdirs() } }; foreach my $t (@$tests) { my $description = $t->{description}; my $volname = $t->{volname}; my $expected = $t->{expected}; diff --git a/src/test/path_to_volume_id_test.pm b/src/test/path_to_volume_id_test.pm index ff162b1d..03753c38 100644 --- a/src/test/path_to_volume_id_test.pm +++ b/src/test/path_to_volume_id_test.pm @@ -4,10 +4,13 @@ use strict; use warnings; use lib qw(..); use PVE::Storage; +use PVE::Storage::Common qw( + plugin_get_default_vtype_subdirs +); use Test::More; use Cwd; use File::Basename; @@ -235,11 +238,12 @@ my @tests = ( ); plan tests => scalar @tests + 1; my $seen_vtype; -my $vtype_subdirs = { map { $_ => 1 } keys %{ PVE::Storage::Plugin::get_vtype_subdirs() } }; +my $vtype_subdirs = + { map { $_ => 1 } keys %{ plugin_get_default_vtype_subdirs() } }; foreach my $tt (@tests) { my $file = $tt->{volname}; my $expected = $tt->{expected}; my $description = $tt->{description}; diff --git a/src/test/run_volume_access_tests.pl b/src/test/run_volume_access_tests.pl index 12d5544e..2de57a26 100755 --- a/src/test/run_volume_access_tests.pl +++ b/src/test/run_volume_access_tests.pl @@ -11,10 +11,13 @@ use Test::More; use lib ('.', '..'); use PVE::API2::Storage::PruneBackups; use PVE::RPCEnvironment; use PVE::Storage; +use PVE::Storage::Common qw( + plugin_get_default_vtype_subdirs +); use PVE::Storage::Plugin; use PVE::Tools; my $storage_dir = tempdir(CLEANUP => 1); @@ -68,11 +71,11 @@ $pve_cluster_module->mock( ); my $rpcenv = PVE::RPCEnvironment->init('pub'); $rpcenv->init_request(); -my @types = sort (keys PVE::Storage::Plugin::get_vtype_subdirs()->%*, qw(vm-vol vm-state ct-vol)); +my @types = sort (keys plugin_get_default_vtype_subdirs()->%*, qw(vm-vol vm-state ct-vol)); my $all_types = { map { $_ => 1 } @types }; my @tests = ( { volid => 'dir:backup/vzdump-qemu-100-2025_07_29-13_00_55.vma', -- 2.47.3