]> git.proxmox.com Git - pve-container.git/commitdiff
When destroying a container, remove bind mounts and block devices from the list of...
authorEmmanuel Kasper <e.kasper@proxmox.com>
Tue, 22 Sep 2015 09:32:37 +0000 (11:32 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 22 Sep 2015 10:53:10 +0000 (12:53 +0200)
src/PVE/LXC.pm

index 93eec436b38282fcbbb309130e2799c50f4ecc49..78a281dfb431a1de82a82374fb10e6ca9e04771c 100644 (file)
@@ -1303,6 +1303,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;
     });