[pve-devel] [PATCH pve-container] When destroying a container, remove bind mounts and block devices from the list of volumes to delete.

Emmanuel Kasper e.kasper at proxmox.com
Tue Sep 22 11:32:37 CEST 2015


---
 src/PVE/LXC.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 3c77c5b..afff9fe 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1294,6 +1294,12 @@ sub destroy_lxc_container {
 
     foreach_mountpoint($conf, sub {
 	my ($ms, $mountpoint) = @_;
+
+	# skip bind mounts and block devices
+	if ($mountpoint->{volume} =~ m|^/|) {
+		return;
+	}
+
 	my ($vtype, $name, $owner) = PVE::Storage::parse_volname($storage_cfg, $mountpoint->{volume});
 	PVE::Storage::vdisk_free($storage_cfg, $mountpoint->{volume}) if $vmid == $owner;
     });
-- 
2.1.4




More information about the pve-devel mailing list