]> git.proxmox.com Git - pve-container.git/commitdiff
umount_all tell caller if we succeeded in $noerr case
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Aug 2019 08:46:28 +0000 (10:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Aug 2019 08:46:28 +0000 (10:46 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC.pm

index 0a1d95ab3f5d82485ad9c2ad4c7f229fb748f150..475d9be08eafb9bbd1bc8680e02ae6091cd45521 100644 (file)
@@ -1142,6 +1142,8 @@ sub umount_all {
     my $rootdir = "/var/lib/lxc/$vmid/rootfs";
     my $volid_list = PVE::LXC::Config->get_vm_volumes($conf);
 
+    my $res = 1;
+
     PVE::LXC::Config->foreach_mountpoint_reverse($conf, sub {
        my ($ms, $mountpoint) = @_;
 
@@ -1160,12 +1162,15 @@ sub umount_all {
        };
        if (my $err = $@) {
            if ($noerr) {
+               $res = 0;
                warn $err;
            } else {
                die $err;
            }
        }
     });
+
+    return $res; # tell caller if (some) umounts failed for the noerr case
 }
 
 sub mount_all {