diff mbox

object: Report type in error when not user creatable.

Message ID 1392763356-29026-1-git-send-email-kroosec@gmail.com
State New
Headers show

Commit Message

Hani Benhabiles Feb. 18, 2014, 10:42 p.m. UTC
Signed-off-by: Hani Benhabiles <hani@linux.com>
---
 qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hu Tao Feb. 19, 2014, 3:46 a.m. UTC | #1
cced: Igor

On Tue, Feb 18, 2014 at 11:42:36PM +0100, Hani Benhabiles wrote:
> Signed-off-by: Hani Benhabiles <hani@linux.com>
> ---
>  qmp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qmp.c b/qmp.c
> index d0d98e7..f556a04 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -556,8 +556,8 @@ void object_add(const char *type, const char *id, const QDict *qdict,
>      }
>  
>      if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
> -        error_setg(&local_err, "object '%s' isn't supported by object-add",
> -                   id);
> +        error_setg(&local_err, "object type '%s' isn't supported by object-add",
> +                   type);
>          goto out;
>      }

Same problem here. In the case what we should let user know is the
type of object, instead of id which is just a normal property of object.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Paolo Bonzini Feb. 19, 2014, 9:10 a.m. UTC | #2
Il 18/02/2014 23:42, Hani Benhabiles ha scritto:
> Signed-off-by: Hani Benhabiles <hani@linux.com>
> ---
>  qmp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qmp.c b/qmp.c
> index d0d98e7..f556a04 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -556,8 +556,8 @@ void object_add(const char *type, const char *id, const QDict *qdict,
>      }
>
>      if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
> -        error_setg(&local_err, "object '%s' isn't supported by object-add",
> -                   id);
> +        error_setg(&local_err, "object type '%s' isn't supported by object-add",
> +                   type);
>          goto out;
>      }
>
>

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Michael Tokarev Feb. 22, 2014, 12:03 p.m. UTC | #3
Thanks, applied to the trivial patches queue.

/mjt
diff mbox

Patch

diff --git a/qmp.c b/qmp.c
index d0d98e7..f556a04 100644
--- a/qmp.c
+++ b/qmp.c
@@ -556,8 +556,8 @@  void object_add(const char *type, const char *id, const QDict *qdict,
     }
 
     if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
-        error_setg(&local_err, "object '%s' isn't supported by object-add",
-                   id);
+        error_setg(&local_err, "object type '%s' isn't supported by object-add",
+                   type);
         goto out;
     }