[pve-devel] [PATCH qemu-server v7 3/4] destroy_vm: use log_warn for vdisk_free errors for consistency

Michael Köppl m.koeppl at proxmox.com
Tue May 27 18:01:39 CEST 2025


To make warnings visually consistent with the handling of other storage
errors in destroy_vm(), replace the use of warn with log_warn.

Signed-off-by: Michael Köppl <m.koeppl at proxmox.com>
---
 PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c0170a38..5eb439a8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2137,7 +2137,7 @@ sub destroy_vm {
 
 	$volids->{$volid} = 1;
 	eval { PVE::Storage::vdisk_free($storecfg, $volid) };
-	warn "Could not remove disk '$volid', check manually: $@" if $@;
+	log_warn("Could not remove disk '$volid', check manually: $@") if $@;
     };
 
     # only remove disks owned by this VM (referenced in the config)
@@ -2161,7 +2161,7 @@ sub destroy_vm {
 	PVE::Storage::foreach_volid($vmdisks, sub {
 	    my ($volid, $sid, $volname, $d) = @_;
 	    eval { PVE::Storage::vdisk_free($storecfg, $volid) };
-	    warn $@ if $@;
+	    log_warn($@) if $@;
 	});
     }
 
-- 
2.39.5





More information about the pve-devel mailing list