rbd: make volume param for get_rbd_path to allow further use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -24,11 +24,10 @@ my $get_parent_image_name = sub {
|
|||||||
|
|
||||||
my sub get_rbd_path {
|
my sub get_rbd_path {
|
||||||
my ($scfg, $volume) = @_;
|
my ($scfg, $volume) = @_;
|
||||||
my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
|
my $path = $scfg->{pool} ? $scfg->{pool} : 'rbd';
|
||||||
my $namespace = $scfg->{namespace};
|
$path .= "/$scfg->{namespace}" if defined($scfg->{namespace});
|
||||||
|
$path .= "/$volume" if defined($volume);
|
||||||
return "${pool}/${namespace}/${volume}" if defined($namespace);
|
return $path;
|
||||||
return "${pool}/${volume}";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
my $build_cmd = sub {
|
my $build_cmd = sub {
|
||||||
@ -540,10 +539,7 @@ sub list_images {
|
|||||||
|
|
||||||
$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';
|
my $dat = $cache->{rbd}->{get_rbd_path($scfg)};
|
||||||
$pool .= "/$scfg->{namespace}" if defined($scfg->{namespace});
|
|
||||||
|
|
||||||
my $dat = $cache->{rbd}->{$pool};
|
|
||||||
return [] if !$dat; # nothing found
|
return [] if !$dat; # nothing found
|
||||||
|
|
||||||
my $res = [];
|
my $res = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user