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

index 60bd4e8672263e92e51be7acabef6478115a0ed6..bbfae7c4fb4f7c0d89661eb0acd4a49cd3bd42c8 100644 (file)
@@ -352,4 +352,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;