diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm index c5d4ff8..8cbfb4f 100755 --- a/src/PVE/Storage.pm +++ b/src/PVE/Storage.pm @@ -213,6 +213,14 @@ sub storage_check_enabled { return storage_check_node($cfg, $storeid, $node, $noerr); } +sub storage_has_feature { + my ($cfg, $storeid, $feature) = @_; + + my $scfg = storage_config($cfg, $storeid); + + return PVE::Storage::Plugin::storage_has_feature($scfg->{type}, $feature); +} + # storage_can_replicate: # return true if storage supports replication # (volumes allocated with vdisk_alloc() has replication feature) diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm index 6e23fec..0efb7d2 100644 --- a/src/PVE/Storage/Plugin.pm +++ b/src/PVE/Storage/Plugin.pm @@ -245,6 +245,16 @@ sub dirs_hash_to_string { return join(',', map { "$_=$hash->{$_}" } sort keys %$hash); } +sub storage_has_feature { + my ($type, $feature) = @_; + + my $data = $defaultData->{plugindata}->{$type}; + if (my $features = $data->{features}) { + return $features->{$feature}; + } + return; +} + sub default_format { my ($scfg) = @_;