From 5b0f9cc848cee4b6bec0b2ad7bda6596e16406ad Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 13 Mar 2025 09:30:26 +0100 Subject: [PATCH] api: create disks: only log cleanup if it's actually done we cleaned up extracted images, but logged it even for non extracted ones. Only log this when we actually cleaned anything up. Signed-off-by: Dominik Csapak --- PVE/API2/Qemu.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index dc8915a7..156b1c7b 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -492,8 +492,10 @@ my sub create_disks : prototype($$$$$$$$$$$) { = $import_from_volid->($storecfg, $source, $dest_info, $vollist); # remove extracted volumes after importing - PVE::Storage::vdisk_free($storecfg, $source) if $needs_extraction; - print "cleaned up extracted image $source\n"; + if ($needs_extraction) { + PVE::Storage::vdisk_free($storecfg, $source); + print "cleaned up extracted image $source\n"; + } @$vollist = grep { $_ ne $source } @$vollist; }; die "cannot import from '$source' - $@" if $@;