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

Philipp Marek philipp.marek at linbit.com
Fri Sep 4 14:05:03 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 | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index cf45fff..7e5cc7d 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -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;
>  
> @@ -1932,7 +1933,8 @@ sub umount_all {
>  	my $mount_path = "$rootdir/$mount";
>  	$mount_path =~ s!/+!/!g;
>  
> -	# fixme: test if mounted?
> +	return !PVE::ProcFSTools::is_mounted($mount_path);
I guess you're missing an "if" here ^^?



More information about the pve-devel mailing list