public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix #5980: importdisk: fix spurious warning
@ 2024-12-09 10:58 Fabian Grünbichler
  2024-12-09 18:48 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Grünbichler @ 2024-12-09 10:58 UTC (permalink / raw)
  To: pve-devel

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>
---
 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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-09 18:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-09 10:58 [pve-devel] [PATCH qemu-server] fix #5980: importdisk: fix spurious warning Fabian Grünbichler
2024-12-09 18:48 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal