public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix #6317: backup: use correct cleanup_fleecing_images helper
@ 2025-04-14 11:59 Wolfgang Bumiller
  2025-04-16 10:49 ` [pve-devel] applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfgang Bumiller @ 2025-04-14 11:59 UTC (permalink / raw)
  To: pve-devel

The local one is specific for `allocate_fleecing_images` and has a
comment stating to use the one from `PVE::QemuConfig` in all other
cases.

The `cleanup` sub already called this, but only if the VM was running.
We do allocate fleecing images for previously-stopped VMs as well,
though, so we also need to do the cleanup.

As for the `detach_fleecing_images()` call: while could have stayed in
the `vm_running_locall()` branch, it also performs this check and this
way the entire fleecing cleanup stays together in one place.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 PVE/VZDump/QemuServer.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 4860798e..10514f75 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -1267,15 +1267,17 @@ sub cleanup {
 	}
 
 	$detach_tpmstate_drive->($task, $vmid);
-	if ($task->{'use-fleecing'}) {
+    }
+
+    if ($task->{'use-fleecing'}) {
+	eval {
 	    detach_fleecing_images($task->{disks}, $vmid);
 	    PVE::QemuConfig::cleanup_fleecing_images(
 		$vmid, $self->{storecfg}, sub { $self->log($_[0], $_[1]); });
-	}
+	};
+	$self->log('warn', "attempt to clean up fleecing images failed - $@") if $@;
     }
 
-    cleanup_fleecing_images($self, $task->{disks}) if $task->{'use-fleecing'};
-
     if ($self->{qmeventd_fh}) {
 	close($self->{qmeventd_fh});
     }
-- 
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

* [pve-devel] applied: [PATCH qemu-server] fix #6317: backup: use correct cleanup_fleecing_images helper
  2025-04-14 11:59 [pve-devel] [PATCH qemu-server] fix #6317: backup: use correct cleanup_fleecing_images helper Wolfgang Bumiller
@ 2025-04-16 10:49 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2025-04-16 10:49 UTC (permalink / raw)
  To: pve-devel, Wolfgang Bumiller

On Mon, 14 Apr 2025 13:59:53 +0200, Wolfgang Bumiller wrote:
> The local one is specific for `allocate_fleecing_images` and has a
> comment stating to use the one from `PVE::QemuConfig` in all other
> cases.
> 
> The `cleanup` sub already called this, but only if the VM was running.
> We do allocate fleecing images for previously-stopped VMs as well,
> though, so we also need to do the cleanup.
> 
> [...]

Applied, thanks!

[1/1] fix #6317: backup: use correct cleanup_fleecing_images helper
      commit: 8009da73f17ad3ca695be6c1067ba3742aefc4db

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>


_______________________________________________
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:[~2025-04-16 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-14 11:59 [pve-devel] [PATCH qemu-server] fix #6317: backup: use correct cleanup_fleecing_images helper Wolfgang Bumiller
2025-04-16 10:49 ` [pve-devel] applied: " Fabian Grünbichler

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