Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
my sub get_rbd_path {
my ($scfg, $volume) = @_;
my sub get_rbd_path {
my ($scfg, $volume) = @_;
- my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
- my $namespace = $scfg->{namespace};
-
- return "${pool}/${namespace}/${volume}" if defined($namespace);
- return "${pool}/${volume}";
+ my $path = $scfg->{pool} ? $scfg->{pool} : 'rbd';
+ $path .= "/$scfg->{namespace}" if defined($scfg->{namespace});
+ $path .= "/$volume" if defined($volume);
+ return $path;
$cache->{rbd} = rbd_ls($scfg, $storeid) if !$cache->{rbd};
$cache->{rbd} = rbd_ls($scfg, $storeid) if !$cache->{rbd};
- my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
- $pool .= "/$scfg->{namespace}" if defined($scfg->{namespace});
-
- my $dat = $cache->{rbd}->{$pool};
+ my $dat = $cache->{rbd}->{get_rbd_path($scfg)};
return [] if !$dat; # nothing found
my $res = [];
return [] if !$dat; # nothing found
my $res = [];