[pve-devel] [RFC qemu-server v3 21/22] destroy vm: clean up potential left-over fleecing images

Fiona Ebner f.ebner at proxmox.com
Thu Apr 11 11:29:42 CEST 2024


To avoid them becoming orphaned.

Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/QemuServer.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 61804ae6..6edd1692 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2231,6 +2231,9 @@ sub check_type {
 sub destroy_vm {
     my ($storecfg, $vmid, $skiplock, $replacement_conf, $purge_unreferenced) = @_;
 
+    eval { PVE::QemuConfig::cleanup_fleecing_images($vmid, $storecfg) };
+    log_warn("attempt to clean up left-over fleecing images failed - $@") if $@;
+
     my $conf = PVE::QemuConfig->load_config($vmid);
 
     if (!$skiplock && !PVE::QemuConfig->has_lock($conf, 'suspended')) {
-- 
2.39.2





More information about the pve-devel mailing list