[Libguestfs] [PATCH v2 1/3] ext2: tweak the error returned message of resize2fs-M(BZ755729)

Richard W.M. Jones rjones at redhat.com
Fri Jan 13 16:09:24 UTC 2012


On Sat, Jan 14, 2012 at 12:03:43AM +0800, Wanlong Gao wrote:
> From: Wanlong Gao <gaowanlong at cn.fujitsu.com>
> 
> Tweak the error message "e2fsck -f" and "e2fsck -fy".
> Indicate the user to use the correct and/or forceall options.
> 
> Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com>
> ---
>  daemon/ext2.c |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/daemon/ext2.c b/daemon/ext2.c
> index 79fd354..c280ca2 100644
> --- a/daemon/ext2.c
> +++ b/daemon/ext2.c
> @@ -277,9 +277,14 @@ do_resize2fs_M (const char *device)
>    if (e2prog (prog) == -1)
>      return -1;
>  
> -  r = command (NULL, &err, prog, "-M" , device, NULL);
> +  r = command (NULL, &err, prog, "-M", device, NULL);
>    if (r == -1) {
> -    reply_with_error ("%s", err);
> +    if (strstr (err, "e2fsck -f")) {
> +      free (err);
> +      reply_with_error ("you need to run e2fsck with the correct and/or forceall options first");
> +    } else {
> +      reply_with_error ("%s", err);
> +    }
>      free (err);
>      return -1;
>    }

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list