From 45fedd4729be9f8afd9f16472761d28dd5a46dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 9 Dec 2024 11:58:53 +0100 Subject: [PATCH] fix #5980: importdisk: fix spurious warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if not target disk is given, it makes no sense to check that it is valid. Signed-off-by: Fabian Grünbichler --- PVE/CLI/qm.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index 030bbb3a..4214a7ca 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -599,7 +599,7 @@ __PACKAGE__->register_method ({ my $target_disk = extract_param($param, 'target-disk'); # 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); PVE::QemuConfig->check_lock($vm_conf);