From: Alexandre Derumier Date: Thu, 14 Feb 2013 10:05:09 +0000 (+0100) Subject: rbd : has_feature : clone from base X-Git-Url: https://git.proxmox.com/?p=pve-storage.git;a=commitdiff_plain;h=1e7ae581943a3564604f72264773be9007b9a7b5 rbd : has_feature : clone from base Signed-off-by: Alexandre Derumier --- diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 01093fd..c24becf 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -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; }