[pve-devel] [PATCH qemu-server] fix #5980: importdisk: fix spurious warning
    Fabian Grünbichler 
    f.gruenbichler at proxmox.com
       
    Mon Dec  9 11:58:53 CET 2024
    
    
  
if not target disk is given, it makes no sense to check that it is valid.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 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);
-- 
2.39.5
    
    
More information about the pve-devel
mailing list