[pve-devel] [PATCH 3/8] rbd : has_feature

Alexandre Derumier aderumier at odiso.com
Thu Dec 27 16:07:15 CET 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/RBDPlugin.pm |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 60bd4e8..bbfae7c 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -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;
-- 
1.7.10.4




More information about the pve-devel mailing list