qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qapi: input_type_enum(): fix error message


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH] qapi: input_type_enum(): fix error message
Date: Sat, 30 Jun 2012 08:31:31 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 06/30/2012 01:40 AM, Luiz Capitulino wrote:
> The enum string is pointed to by 'enum_str' not 'name'. This bug
> causes the error message to be:
> 
> { "error": { "class": "InvalidParameter",
>              "desc": "Invalid parameter 'null'",
>              "data": { "name": "null" } } }
> 
> Signed-off-by: Luiz Capitulino <address@hidden>

Looks good.
Reviewed-by: Amos Kong <address@hidden>


> ---
> 
> I've caught this while reviewing the sendkey conversion series. Not sure if
> any in tree code can trigger this.
> 
>  qapi/qapi-visit-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
> index ffffbf7..705eca9 100644
> --- a/qapi/qapi-visit-core.c
> +++ b/qapi/qapi-visit-core.c
> @@ -298,7 +298,7 @@ void input_type_enum(Visitor *v, int *obj, const char 
> *strings[],
>      }
>  
>      if (strings[value] == NULL) {
> -        error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
> +        error_set(errp, QERR_INVALID_PARAMETER, enum_str);
>          g_free(enum_str);
>          return;
>      }


-- 
                        Amos.



reply via email to

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