[pve-devel] [PATCH pve-storage 1/2] PVE::Storage::volume_snapshot_list - remove $prefix parameter

Dietmar Maurer dietmar at proxmox.com
Wed Jun 7 06:43:11 CEST 2017


Always return the full list of snapshots. Users of this library can easily
filter with a simply 'grep' instead.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/Storage.pm               | 4 ++--
 PVE/Storage/Plugin.pm        | 2 +-
 PVE/Storage/ZFSPlugin.pm     | 2 +-
 PVE/Storage/ZFSPoolPlugin.pm | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index cfd7b2c..0b40416 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -264,13 +264,13 @@ sub volume_has_feature {
 }
 
 sub volume_snapshot_list {
-    my ($cfg, $volid, $prefix) = @_;
+    my ($cfg, $volid) = @_;
 
     my ($storeid, $volname) = parse_volume_id($volid, 1);
     if ($storeid) {
 	my $scfg = storage_config($cfg, $storeid);
 	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) {
 	die "send file/device '$volid' is not possible\n";
     } else {
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 4df6608..6d94b64 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -825,7 +825,7 @@ sub status {
 }
 
 sub volume_snapshot_list {
-    my ($class, $scfg, $storeid, $volname, $prefix) = @_;
+    my ($class, $scfg, $storeid, $volname) = @_;
 
     # implement in subclass
     die "Volume_snapshot_list is not implemented for $class";
diff --git a/PVE/Storage/ZFSPlugin.pm b/PVE/Storage/ZFSPlugin.pm
index 032bdf0..8658f0e 100644
--- a/PVE/Storage/ZFSPlugin.pm
+++ b/PVE/Storage/ZFSPlugin.pm
@@ -363,7 +363,7 @@ sub volume_has_feature {
 }
 
 sub volume_snapshot_list {
-    my ($class, $scfg, $storeid, $volname, $prefix) = @_;
+    my ($class, $scfg, $storeid, $volname) = @_;
     # return an empty array if dataset does not exist.
     die "Volume_snapshot_list is not implemented for ZFS over iSCSI.\n";
 }
diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index bc9da23..c8415eb 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -495,7 +495,7 @@ sub volume_rollback_is_possible {
 }
 
 sub volume_snapshot_list {
-    my ($class, $scfg, $storeid, $volname, $prefix) = @_;
+    my ($class, $scfg, $storeid, $volname) = @_;
 
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
@@ -510,7 +510,7 @@ sub volume_snapshot_list {
     my $outfunc = sub {
 	my $line = shift;
 
-	if ($line =~ m/^\Q$zpath\E@(\Q$prefix\E.*)$/) {
+	if ($line =~ m/^\Q$zpath\E@(.*)$/) {
 	    push @$snaps, $1;
 	}
     };
-- 
2.11.0




More information about the pve-devel mailing list