]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
PVE::Storage::storage_can_replicate - hew helper
[pve-storage.git] / PVE / Storage.pm
index 4772c6c06c1f2b64b8b4903d457ba77ffbb25481..cf1e5ec9a7565fccebdb5739484ae8a254aef39b 100755 (executable)
@@ -145,6 +145,17 @@ sub storage_check_enabled {
     return storage_check_node($cfg, $storeid, $node, $noerr);
 }
 
+# storage_can_replicate:
+# return true if storage supports replication
+# (volumes alocated with vdisk_alloc() has replication feature)
+sub storage_can_replicate {
+    my ($cfg, $storeid, $format) = @_;
+
+    my $scfg = storage_config($cfg, $storeid);
+    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+    return $plugin->storage_can_replicate($scfg, $storeid, $format);
+}
+
 sub storage_ids {
     my ($cfg) = @_;