From 9bc7fa7ad2ca9e17ece49067c7438a663a1224c8 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 14 Feb 2013 11:05:11 +0100 Subject: [PATCH] nexenta : has_feature : clone base Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index c21b15c..99140ee 100644 --- a/PVE/Storage/NexentaPlugin.pm +++ b/PVE/Storage/NexentaPlugin.pm @@ -479,12 +479,20 @@ sub volume_has_feature { my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_; my $features = { - snapshot => { current => 1, snap => 1}, - clone => { snap => 1}, + snapshot => { current => 1, 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; }