[pve-devel] [PATCH_V2 1/2] check is mounted before try to unmount disk.

Wolfgang Link w.link at proxmox.com
Thu Sep 3 08:58:18 CEST 2015


this is neccessay because otherwise when a storage is not mounted, like when it is offline, the migration crash.
---
 src/PVE/LXC.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 1c9c1a5..7de3975 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -12,7 +12,7 @@ use PVE::Storage;
 use PVE::SafeSyslog;
 use PVE::INotify;
 use PVE::JSONSchema qw(get_standard_option);
-use PVE::Tools qw($IPV6RE $IPV4RE dir_glob_foreach);
+use PVE::Tools qw($IPV6RE $IPV4RE dir_glob_foreach is_mounted);
 use PVE::Network;
 use PVE::AccessControl;
 
@@ -1931,7 +1931,8 @@ sub umount_all {
 	my $mount_path = "$rootdir/$mount";
 	$mount_path =~ s!/+!/!g;
 
-	# fixme: test if mounted?
+	return if !is_mounted($mount_path);
+
 	eval {
 	    PVE::Tools::run_command(['umount', '-d', $mount_path]);
 	};
-- 
2.1.4





More information about the pve-devel mailing list