[pve-devel] [PATCH qemu-server v8 1/4] adapt linked clone check to not die if an error occurs during check

Michael Köppl m.koeppl at proxmox.com
Thu Jun 26 18:06:23 CEST 2025


Align error handling behavior when checking for linked clones with the
rest of destroy_vm's error handling approach. In case an error occurred,
a warning is printed and the execution continues, since:

1. The same validation occurs later in the process
2. The VM removal will still be blocked if the volume has linked clones

Originally-by: Stefan Hrdlicka <s.hrdlicka at proxmox.com>
 [ MK: log_warn if check fails instead of ignoring
       resolve style nits ]
Signed-off-by: Michael Köppl <m.koeppl at proxmox.com>
---
 src/PVE/QemuServer.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index e7c98520..365e1183 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1897,8 +1897,10 @@ sub destroy_vm {
                 my $volid = $drive->{file};
                 return if !$volid || $volid =~ m|^/|;
 
-                die "base volume '$volid' is still in use by linked cloned\n"
-                    if PVE::Storage::volume_is_base_and_used($storecfg, $volid);
+                my $result = eval { PVE::Storage::volume_is_base_and_used($storecfg, $volid) };
+                log_warn("failed to check if volume '$volid' is used by linked clones: $@")
+                    if $@;
+                die "base volume '$volid' is still in use by linked cloned\n" if $result;
 
             },
         );
-- 
2.39.5





More information about the pve-devel mailing list