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

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jul 30 10:36:59 CEST 2025


On July 29, 2025 1:15 pm, Wolfgang Bumiller wrote:
> Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
> ---
>  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') {

shouldn't we also check for 'images' as well? we don't want that to
overlap with vm-vol or ct-vol!

> +                $check->('vm-vol');
> +                $check->('ct-vol');
> +            } elsif ($vtype eq 'rootdir') {

same here, since this was actually mapped to the dir for 'images' in
practice?

> +                $check->('ct-vol');
> +            } else {
> +                $check->($vtype);
> +            }
>          }
>      }
>  }
> -- 
> 2.47.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




More information about the pve-devel mailing list