fix #5980: importdisk: fix spurious warning

if not target disk is given, it makes no sense to check that it is valid.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-12-09 11:58:53 +01:00 committed by Thomas Lamprecht
parent 4b6051485e
commit 45fedd4729

View File

@ -599,7 +599,7 @@ __PACKAGE__->register_method ({
my $target_disk = extract_param($param, 'target-disk'); my $target_disk = extract_param($param, 'target-disk');
# do_import does not allow invalid drive names (e.g. unused0) # do_import does not allow invalid drive names (e.g. unused0)
$target_disk = undef if !is_valid_drivename($target_disk); $target_disk = undef if $target_disk && !is_valid_drivename($target_disk);
my $vm_conf = PVE::QemuConfig->load_config($vmid); my $vm_conf = PVE::QemuConfig->load_config($vmid);
PVE::QemuConfig->check_lock($vm_conf); PVE::QemuConfig->check_lock($vm_conf);