sheepdog : has_feature : clone base

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

View File

@ -431,11 +431,19 @@ sub volume_has_feature {
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;
} }