qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages
Date: Mon, 26 Oct 2015 20:26:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/26/2015 05:45 PM, John Snow wrote:
> Reported-by: Max Reitz <address@hidden>
> Signed-off-by: John Snow <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> ---
>  qemu-io-cmds.c | 53 ++++++++++++++++++++++++++++++++++-------------------
>  1 file changed, 34 insertions(+), 19 deletions(-)
> 
> diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
> index 44d24e8..92c6b87 100644
> --- a/qemu-io-cmds.c
> +++ b/qemu-io-cmds.c
> @@ -146,6 +146,21 @@ static int64_t cvtnum(const char *s)
>      return ret;
>  }
>  
> +static void print_cvtnum_err(int64_t rc, const char *arg)
> +{
> +    switch (rc) {
> +    case -EINVAL:
> +        printf("Parsing error: non-numeric argument,"
> +               " or extraneous/unrecognized suffix -- %s\n", arg);
> +        break;
> +    case -ERANGE:
> +        printf("Parsing error: argument too large -- %s\n", arg);
> +        break;
> +    default:
> +        printf("Parsing error -- %s\n", arg);

I still think ':' is better than ' --' in error messages, but I'll leave
it up to the maintainer.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]