]> git.proxmox.com Git - pve-storage.git/commitdiff
sheepdog : has_feature
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 27 Dec 2012 15:07:16 +0000 (16:07 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 28 Dec 2012 06:52:43 +0000 (07:52 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Storage/SheepdogPlugin.pm

index fe6cb68985e49932f0625768bcef99e2083fb051..455a378d256ebdff1d56d01df77cf635740f018c 100644 (file)
@@ -325,4 +325,18 @@ sub volume_snapshot_delete {
     return undef;
 }
 
+sub volume_has_feature {
+    my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
+
+    my $features = {
+       snapshot => { current => 1, snap => 1},
+       clone => { snap => 1},
+    };
+
+    my $snap = $snapname ? 'snap' : 'current';
+    return 1 if $features->{$feature}->{$snap};
+
+    return undef;
+}
+
 1;