]> git.proxmox.com Git - pve-container.git/commitdiff
deactivate all mountpoint at ct stop
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 14 Aug 2015 12:56:45 +0000 (14:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 14 Aug 2015 14:26:24 +0000 (16:26 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/LXC.pm

index 74f8683e47a8f9f2992cae66f63eccec074f8a15..af3e223bb95e3c8b0d7019b5e9b9fc23852e07b7 100644 (file)
@@ -1230,12 +1230,14 @@ sub destroy_lxc_container {
 }
 
 sub vm_stop_cleanup {
-    my ($storeage_cfg, $vmid, $conf, $keepActive) = @_;
+    my ($storage_cfg, $vmid, $conf, $keepActive) = @_;
     
     eval {
        if (!$keepActive) {
-           my $rootinfo = PVE::LXC::parse_ct_mountpoint($conf->{rootfs});
-           PVE::Storage::deactivate_volumes($storeage_cfg, [$rootinfo->{volume}]);
+            PVE::LXC::foreach_mountpoint($conf, sub {
+               my ($ms, $mountpoint) = @_;
+               PVE::Storage::deactivate_volumes($storage_cfg, [$mountpoint->{volume}]);
+            });
        }
     };
     warn $@ if $@; # avoid errors - just warn