[pve-devel] [PATCH 24/44] sheepdog : has_feature : clone base

Alexandre Derumier aderumier at odiso.com
Tue Feb 5 12:55:51 CET 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/SheepdogPlugin.pm |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm
index ae6a837..deafe47 100644
--- a/PVE/Storage/SheepdogPlugin.pm
+++ b/PVE/Storage/SheepdogPlugin.pm
@@ -403,15 +403,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 = {
+   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