The 'pool' property in the result of zfs_parse_zvol_list() was not
used for anything else.
No functional change is intended.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
# static zfs helper methods
sub zfs_parse_zvol_list {
# static zfs helper methods
sub zfs_parse_zvol_list {
+ my ($text, $pool) = @_;
my @parts = split /\//, $dataset;
next if scalar(@parts) < 2; # we need pool/name
my $name = pop @parts;
my @parts = split /\//, $dataset;
next if scalar(@parts) < 2; # we need pool/name
my $name = pop @parts;
- my $pool = join('/', @parts);
+ my $parsed_pool = join('/', @parts);
+ next if $parsed_pool ne $pool;
next unless $name =~ m!^(vm|base|subvol|basevol)-(\d+)-(\S+)$!;
$zvol->{owner} = $2;
next unless $name =~ m!^(vm|base|subvol|basevol)-(\d+)-(\S+)$!;
$zvol->{owner} = $2;
$zvol->{name} = $name;
if ($type eq 'filesystem') {
if ($refquota eq 'none') {
$zvol->{name} = $name;
if ($type eq 'filesystem') {
if ($refquota eq 'none') {
'-Hrp',
$scfg->{pool},
);
'-Hrp',
$scfg->{pool},
);
- my $zvols = zfs_parse_zvol_list($text);
+ my $zvols = zfs_parse_zvol_list($text, $scfg->{pool});
return {} if !$zvols;
my $list = {};
foreach my $zvol (@$zvols) {
return {} if !$zvols;
my $list = {};
foreach my $zvol (@$zvols) {
- # The "pool" in $scfg is not the same as ZFS pool, so it's necessary to filter here.
- next if $scfg->{pool} ne $zvol->{pool};
-
my $name = $zvol->{name};
my $parent = $zvol->{origin};
if($zvol->{origin} && $zvol->{origin} =~ m/^$scfg->{pool}\/(\S+)$/){
my $name = $zvol->{name};
my $parent = $zvol->{origin};
if($zvol->{origin} && $zvol->{origin} =~ m/^$scfg->{pool}\/(\S+)$/){