5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-02-09 09:57:38 +03:00

storage : has_feature

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2012-12-27 16:07:13 +01:00 committed by Dietmar Maurer
parent e8acaa3c0d
commit 99473759b2

View File

@ -183,6 +183,21 @@ sub volume_snapshot_delete {
}
}
sub volume_has_feature {
my ($cfg, $feature, $volid, $snap, $running) = @_;
my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) {
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
return $plugin->volume_has_feature($scfg, $feature, $storeid, $volname, $snap, $running);
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
return undef;
} else {
return undef;
}
}
sub get_image_dir {
my ($cfg, $storeid, $vmid) = @_;