X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=PVE%2FAPI2%2FDisks%2FLVMThin.pm;fp=PVE%2FAPI2%2FDisks%2FLVMThin.pm;h=62d3b61ef42d3fa39e0fe6bb108bbf0ba4d10297;hb=76c1e57be7c8495586e38205611290db049896e0;hp=5b72c8c478d233fb73a4478a0b526853a99a782c;hpb=94836d7b8c002ea59590682df8f00568ee3f015b;p=pve-storage.git diff --git a/PVE/API2/Disks/LVMThin.pm b/PVE/API2/Disks/LVMThin.pm index 5b72c8c..62d3b61 100644 --- a/PVE/API2/Disks/LVMThin.pm +++ b/PVE/API2/Disks/LVMThin.pm @@ -103,13 +103,8 @@ __PACKAGE__->register_method ({ my $node = $param->{node}; $dev = PVE::Diskmanage::verify_blockdev_path($dev); - die "device $dev is already in use\n" if PVE::Diskmanage::disk_is_used($dev); - - my $cfg = PVE::Storage::config(); - - if (my $scfg = PVE::Storage::storage_config($cfg, $name, 1)) { - die "storage ID '$name' already defined\n"; - } + PVE::Diskmanage::check_unused($dev); + PVE::Storage::check_available($name); my $worker = sub { PVE::Diskmanage::locked_disk_action(sub {