[pve-devel] [PATCH 4/8] deactivate all mountpoint at ct stop

Alexandre Derumier aderumier at odiso.com
Fri Aug 14 14:56:45 CEST 2015


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 src/PVE/LXC.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index d81791e..7fa75eb 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1198,12 +1198,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
-- 
2.1.4




More information about the pve-devel mailing list