refactor disk/storage checks for Disk API
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
94836d7b8c
commit
76c1e57be7
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user