Skip to contentSkip to conversation

object: Report type in error when not user creatable.

PATCH Applied Hani Benhabiles 4 participants 4 messages Feb 18, 2014 – Feb 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 object: Report type in error when not user creatable.

---
 qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qmp.c +2 -2
index d0d98e7..f556a04 100644
@@ -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;
     }
 
Signature · 1 line
1.8.3.2
Reviewed-by on v1 1/1
#1 lore raw

cced: Igor

Quoted 10 lines · Hani Benhabiles
---
 qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qmp.c +0 -0
index d0d98e7..f556a04 100644

qmp.c void object_add(const char *type, const char *id, const QDict *qdict, · line 562

Quoted 9 lines
qmp.c +2 -2
@@ -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.

Acked-by on v1 1/1
#2 lore raw
In reply to Hani Benhabiles

Il 18/02/2014 23:42, Hani Benhabiles ha scritto:

Quoted 11 lines
---
 qmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
qmp.c +0 -0
index d0d98e7..f556a04 100644

qmp.c void object_add(const char *type, const char *id, const QDict *qdict, · line 563

Quoted 10 lines
qmp.c +2 -2
@@ -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;
     }
 

Paolo