]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
Include new storage function volume_snapshot_list.
[pve-storage.git] / PVE / Storage.pm
index 47948188a623ac16e753391f7d05922027b8f3d9..8fe9f4b013a873a8101deaec27ce7380b8b1cf93 100755 (executable)
@@ -280,6 +280,23 @@ sub volume_has_feature {
     }
 }
 
+sub volume_snapshot_list {
+    my ($cfg, $volid, $prefix, $ip) = @_;
+
+    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, $ip);
+    } elsif ($volid =~ m|^(/.+)$| && -e $volid) {
+       die "send file/device '$volid' is not possible\n";
+    } else {
+       die "unable to parse volume ID '$volid'\n";
+    }
+    # return an empty array if dataset does not exist.
+    # youngest snap first
+}
+
 sub get_image_dir {
     my ($cfg, $storeid, $vmid) = @_;