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

Fiona Ebner f.ebner at proxmox.com
Wed May 21 12:49:38 CEST 2025


Am 20.05.25 um 11:08 schrieb Michael Köppl:
> Align error handling behavior when checking for linked clones with the
> rest of destroy_vm's error handling approach. Unlike the LXC destroy
> implementation, this version continues execution when encountering
> errors during the check, since:
> 
> 1. The same validation occurs later in the process
> 2. This prevents potential crashes

What kind of crashes?

> 3. The VM removal will still be blocked if the volume has linked clones
> 
> Align error handling behavior when checking for linked clones with the
> rest of destroy_vm's error handling approach. Unlike the LXC implementation,
> this version continues execution when encountering errors during the check,
> since:

This paragraph is duplicated.

> 
> Co-authored-by: Stefan Hrdlicka

The qemu-server patches still need to have the trailer adapted.

> Signed-off-by: Michael Köppl <m.koeppl at proxmox.com>
> ---
>  PVE/QemuServer.pm | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 577959a4..e02bf7d4 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -2116,9 +2116,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);
> -
> +		# errors that occur during this check are not propagated since the
> +		# same check is done again in vdisk_free

For containers, you do propagate the error. Please adapt the code there
too to make it consistent. I'd also add a warning or print an
informational message about the failure, rather than quietly ignoring it.

> +		my $result = eval { PVE::Storage::volume_is_base_and_used($storecfg, $volid) };
> +		die "base volume '$volid' is still in use by linked cloned\n" if $result;
>  	});
>      }
>  





More information about the pve-devel mailing list