[pve-devel] [PATCH container 2/3] fix deletion of backup snapshots

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed May 25 10:05:17 CEST 2016


add missing checks for non-backed up mountpoints
---
 src/PVE/LXC/Config.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 933e6ca..6b4ec4c 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -124,7 +124,9 @@ sub __snapshot_delete_remove_drive {
 	my $value = $snap->{$remove_drive};
 	my $mountpoint = $remove_drive eq 'rootfs' ? $class->parse_ct_rootfs($value, 1) : $class->parse_ct_mountpoint($value, 1);
 	delete $snap->{$remove_drive};
-	$class->add_unused_volume($snap, $mountpoint->{volume});
+
+	$class->add_unused_volume($snap, $mountpoint->{volume})
+	    if ($mountpoint->{type} eq 'volume');
     }
 }
 
@@ -137,6 +139,9 @@ sub __snapshot_delete_vmstate_file {
 sub __snapshot_delete_vol_snapshot {
     my ($class, $vmid, $ms, $mountpoint, $snapname, $unused) = @_;
 
+    return if $snapname eq 'vzdump' &&
+	!$class->mountpoint_backup_enabled($ms, $mountpoint);
+
     my $storecfg = PVE::Storage::config();
     PVE::Storage::volume_snapshot_delete($storecfg, $mountpoint->{volume}, $snapname);
     push @$unused, $mountpoint->{volume};
-- 
2.1.4





More information about the pve-devel mailing list