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

index 01093fde6bca79bc84ea45aa1e6b24186c0c312e..c24becfcc78402d1f66408a9e63968b660de6863 100644 (file)
@@ -470,11 +470,19 @@ sub volume_has_feature {
 
    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;
 }