refactor disk/storage checks for Disk API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak
2018-09-25 10:38:00 +02:00
committed by Thomas Lamprecht
parent 94836d7b8c
commit 76c1e57be7
6 changed files with 27 additions and 21 deletions

View File

@ -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;