]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage.pm
refactor disk/storage checks for Disk API
[pve-storage.git] / PVE / Storage.pm
index f9732feec778b1623e19362341a77baf068f7eb1..81f9b67508538cd4de065cdda781bc0acda60aee 100755 (executable)
@@ -1647,4 +1647,16 @@ sub get_bandwidth_limit {
     return $override;
 }
 
+# checks if the storage id is available and dies if not
+sub check_available {
+    my ($id) = @_;
+
+    my $cfg = config();
+    if (my $scfg = storage_config($cfg, $id, 1)) {
+       die "storage ID '$id' already defined\n";
+    }
+
+    return undef;
+}
+
 1;