Otherwise, a rescan operation would add fleecing images as unused
disks, even if they are already recorded in the special 'fleecing'
section.

Usually, fleecing images are cleaned up directly after backup, so this
is less likely to be an issue after commit 8009da73 ("fix #6317:
backup: use correct cleanup_fleecing_images helper"), but still makes
sense for future-proofing and for other edge cases where cleanup might
have failed.

Reported-by: Maximiliano Sandoval <m.sando...@proxmox.com>
Signed-off-by: Fiona Ebner <f.eb...@proxmox.com>
---
 PVE/QemuServer.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ccdceedc..577959a4 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6965,6 +6965,10 @@ sub update_disk_config {
        $referencedpath->{$path} = 1 if $path;
     });
 
+    if (my $fleecing = $conf->{'special-sections'}->{fleecing}) {
+       $referenced->{$_} = 1 for 
PVE::Tools::split_list($fleecing->{'fleecing-images'});
+    }
+
     foreach my $volid (sort keys %$volid_hash) {
        next if $volid =~ m/vm-$vmid-state-/;
        next if $referenced->{$volid};
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to