]> git.proxmox.com Git - pve-container.git/commitdiff
check is mounted before try to unmount disk.
authorWolfgang Link <w.link@proxmox.com>
Fri, 4 Sep 2015 12:29:13 +0000 (14:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Sun, 6 Sep 2015 08:45:19 +0000 (10:45 +0200)
this is neccessay because otherwise when a storage is not mounted, like when it is offline, the migration crash.

src/PVE/LXC.pm

index 53392a1438dbad9d13b1286b6aefcbcefe40fdf0..abb8567e43519956eed32fbce0785e77fdb4e804 100644 (file)
@@ -15,6 +15,7 @@ use PVE::JSONSchema qw(get_standard_option);
 use PVE::Tools qw($IPV6RE $IPV4RE dir_glob_foreach);
 use PVE::Network;
 use PVE::AccessControl;
+use PVE::ProcFSTools;
 
 use Data::Dumper;
 
@@ -1951,7 +1952,8 @@ sub umount_all {
        my $mount_path = "$rootdir/$mount";
        $mount_path =~ s!/+!/!g;
 
-       # fixme: test if mounted?
+       return if !PVE::ProcFSTools::is_mounted($mount_path);
+
        eval {
            PVE::Tools::run_command(['umount', '-d', $mount_path]);
        };