rbd : has_feature : clone from base
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
dc4f2cb33d
commit
1e7ae58194
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user