qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 08/29] qmp: improve error reporting for -obje


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH v4 08/29] qmp: improve error reporting for -object and object-add
Date: Mon, 9 Jun 2014 17:57:20 +0200

On Mon, 9 Jun 2014 18:25:13 +0800
Hu Tao <address@hidden> wrote:

> From: Paolo Bonzini <address@hidden>
> 
> Use QERR_INVALID_PARAMETER_VALUE for consistency.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Hu Tao <address@hidden>
> Reviewed-by: Eduardo Habkost <address@hidden>
> ---
>  qmp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/qmp.c b/qmp.c
> index b722dbe..cef60fb 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -540,7 +540,8 @@ void object_add(const char *type, const char *id, const 
> QDict *qdict,
>  
>      klass = object_class_by_name(type);
>      if (!klass) {
> -        error_setg(errp, "invalid class name");
> +        error_set(errp, QERR_INVALID_PARAMETER_VALUE,
> +                  "qom-type", "a valid class name");
With implicit "qom-type" on CLI it might be not clear to user what value is
wrong. Perhaps following would be better:

error_setg(errp, "Invalid object type name: %s", type);
 
>          return;
>      }
>  
> -- 
> 1.9.3
> 


-- 
Regards,
  Igor



reply via email to

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