[pve-devel] [PATCH 16/16] rbd : has_feature : clone from base

Alexandre Derumier aderumier at odiso.com
Sun Feb 3 09:49:43 CET 2013


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

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 922e309..4a9ee8d 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -473,15 +473,20 @@ sub volume_snapshot_delete {
 }
 
 sub volume_has_feature {
-    my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
+    my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running, $isBase) = @_;
 
    my $features = {
         snapshot => { current => 1, snap => 1},
-        clone => { snap => 1},
+        clone => { base => 1},
     };
 
-    my $snap = $snapname ? 'snap' : 'current';
-    return 1 if $features->{$feature}->{$snap};
+    my $key = undef;
+    if($snapname){
+	$key = $snapname
+    }else{
+	$key =  $isBase ? 'base' : 'current';
+    }
+    return 1 if $features->{$feature}->{$key};
 
     return undef;
 }
-- 
1.7.10.4




More information about the pve-devel mailing list