plugin : has_feature
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
99473759b2
commit
f884fe1125
@ -558,6 +558,24 @@ sub volume_snapshot_delete {
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub volume_has_feature {
|
||||||
|
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
|
||||||
|
|
||||||
|
my $features = {
|
||||||
|
snapshot => { current => { qcow2 => 1}, snap => { qcow2 => 1} },
|
||||||
|
clone => { current => {qcow2 => 1, raw => 1, vmdk => 1} },
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($volname =~ m!^(\d+)/(\S+)$!) {
|
||||||
|
my ($vmid, $name) = ($1, $2);
|
||||||
|
my (undef, $format) = parse_name_dir($name);
|
||||||
|
my $snap = $snapname ? 'snap' : 'current';
|
||||||
|
return 1 if defined($features->{$feature}->{$snap}->{$format});
|
||||||
|
|
||||||
|
}
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
sub list_images {
|
sub list_images {
|
||||||
my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;
|
my ($class, $storeid, $scfg, $vmid, $vollist, $cache) = @_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user