[pve-devel] [PATCH storage 12/26] plugin: support new vtypes in activate_storage checks

Wolfgang Bumiller
2025-07-29T11:17:01Z

src/PVE/Storage/Plugin.pm | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index 98788d1..047b2fc 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -1882,15 +1882,31 @@ sub activate_storage {

# check that content dirs are pairwise inequal
my $resolved_subdirs = {};
- for my $vtype (sort keys $scfg->{content}->%*) {
+ my %done;
+ my $check = sub {
+ my ($vtype) = @_;
+
+ return if $done{$vtype};
+ $done{$vtype} = 1;
+
my $subdir = $class->get_subdir($scfg, $vtype);
my $abs_subdir = abs_path($subdir);
- next if !defined($abs_subdir);
+ return if !defined($abs_subdir);

die "storage '$storeid' uses directory $abs_subdir for multiple content types\n"
if defined($abs_subdir) && defined($resolved_subdirs->{$abs_subdir});

$resolved_subdirs->{$abs_subdir} = 1;
+ };
+ for my $vtype (sort keys $scfg->{content}->%*) {
+ if ($vtype eq 'images') {
+ $check->('vm-vol');
+ $check->('ct-vol');
+ } elsif ($vtype eq 'rootdir') {
+ $check->('ct-vol');
+ } else {
+ $check->($vtype);
+ }
}
}
}