]> git.proxmox.com Git - pve-storage.git/commitdiff
sheepdog : has_feature : clone base
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 14 Feb 2013 10:05:10 +0000 (11:05 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Feb 2013 10:11:21 +0000 (11:11 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Storage/SheepdogPlugin.pm

index 33f2623d9da7ab2520ce3e8f370b642c3a55f7a6..33b83bb0c97c6e7f0c2e6d3f105e1bfef852cee5 100644 (file)
@@ -429,13 +429,21 @@ sub volume_snapshot_delete {
 sub volume_has_feature {
     my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
 
-    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 ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
+        $class->parse_volname($volname);
+
+    my $key = undef;
+    if($snapname){
+       $key = $snapname
+    }else{
+       $key =  $isBase ? 'base' : 'current';
+    }
+    return 1 if $features->{$feature}->{$key};
 
     return undef;
 }