nexenta : has_feature : clone base

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier
2013-02-14 11:05:11 +01:00
committed by Dietmar Maurer
parent 7516817760
commit 9bc7fa7ad2

View File

@ -479,12 +479,20 @@ sub volume_has_feature {
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_; my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
my $features = { my $features = {
snapshot => { current => 1, snap => 1}, snapshot => { current => 1, snap => 1},
clone => { snap => 1}, clone => { base => 1},
}; };
my $snap = $snapname ? 'snap' : 'current'; my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
return 1 if $features->{$feature}->{$snap}; $class->parse_volname($volname);
my $key = undef;
if($snapname){
$key = $snapname
}else{
$key = $isBase ? 'base' : 'current';
}
return 1 if $features->{$feature}->{$key};
return undef; return undef;
} }