[pve-devel] [PATCH container 1/3] Fix #791: warn when resize2fs fails

Dietmar Maurer dietmar at proxmox.com
Fri Feb 5 10:42:03 CET 2016


> -			PVE::Tools::run_command(['unshare', '-m', '--', 'sh', '-c', $cmd]);
> +			eval {
> +			    PVE::Tools::run_command(['unshare', '-m', '--', 'sh', '-c', $cmd]);
> +			};

I would also add the 'warn' statement directly after the eval here

>  		    } else {
> -			PVE::Tools::run_command(['e2fsck', '-f', '-y', $path]);
> -			PVE::Tools::run_command(['resize2fs', $path]);
> +			eval {
> +			    PVE::Tools::run_command(['e2fsck', '-f', '-y', $path]);
> +			    PVE::Tools::run_command(['resize2fs', $path]);
> +			};

and here

>  		    }

instead of this one

> +		    warn "Failed to update the container's filesystem: $@\n";




More information about the pve-devel mailing list