PVE::Storage::volume_snapshot_list - remove $prefix parameter

Always return the full list of snapshots. Users of this library can easily
filter with a simply 'grep' instead.
This commit is contained in:
Dietmar Maurer
2017-06-07 06:20:07 +02:00
parent c2bce0ef63
commit 8b622c2dff
4 changed files with 6 additions and 6 deletions

View File

@ -264,13 +264,13 @@ sub volume_has_feature {
} }
sub volume_snapshot_list { sub volume_snapshot_list {
my ($cfg, $volid, $prefix) = @_; my ($cfg, $volid) = @_;
my ($storeid, $volname) = parse_volume_id($volid, 1); my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) { if ($storeid) {
my $scfg = storage_config($cfg, $storeid); my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type}); my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
return $plugin->volume_snapshot_list($scfg, $storeid, $volname, $prefix); return $plugin->volume_snapshot_list($scfg, $storeid, $volname);
} elsif ($volid =~ m|^(/.+)$| && -e $volid) { } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
die "send file/device '$volid' is not possible\n"; die "send file/device '$volid' is not possible\n";
} else { } else {

View File

@ -825,7 +825,7 @@ sub status {
} }
sub volume_snapshot_list { sub volume_snapshot_list {
my ($class, $scfg, $storeid, $volname, $prefix) = @_; my ($class, $scfg, $storeid, $volname) = @_;
# implement in subclass # implement in subclass
die "Volume_snapshot_list is not implemented for $class"; die "Volume_snapshot_list is not implemented for $class";

View File

@ -363,7 +363,7 @@ sub volume_has_feature {
} }
sub volume_snapshot_list { sub volume_snapshot_list {
my ($class, $scfg, $storeid, $volname, $prefix) = @_; my ($class, $scfg, $storeid, $volname) = @_;
# return an empty array if dataset does not exist. # return an empty array if dataset does not exist.
die "Volume_snapshot_list is not implemented for ZFS over iSCSI.\n"; die "Volume_snapshot_list is not implemented for ZFS over iSCSI.\n";
} }

View File

@ -495,7 +495,7 @@ sub volume_rollback_is_possible {
} }
sub volume_snapshot_list { sub volume_snapshot_list {
my ($class, $scfg, $storeid, $volname, $prefix) = @_; my ($class, $scfg, $storeid, $volname) = @_;
my ($vtype, $name, $vmid) = $class->parse_volname($volname); my ($vtype, $name, $vmid) = $class->parse_volname($volname);
@ -510,7 +510,7 @@ sub volume_snapshot_list {
my $outfunc = sub { my $outfunc = sub {
my $line = shift; my $line = shift;
if ($line =~ m/^\Q$zpath\E@(\Q$prefix\E.*)$/) { if ($line =~ m/^\Q$zpath\E@(.*)$/) {
push @$snaps, $1; push @$snaps, $1;
} }
}; };