aboutsummaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2015-05-13 17:14:05 +0100
committerAndreas Färber <afaerber@suse.de>2015-06-19 18:40:00 +0200
commitbc2256c4ae86308a1521c89456b599d441119418 (patch)
tree8a9a2cb0a8d570459730143e3326ea0572054f93 /qmp.c
parentf08f9271bfe3f19a5eb3d7a2f48532065304d5c8 (diff)
qom: Add helper function for getting user objects root
Add object_get_objects_root() function which is a convenience for obtaining the Object * located at /objects in the object composition tree. Convert existing code over to use the new API where appropriate. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qmp.c b/qmp.c
index 3f5dfe3f51..fa013e31b8 100644
--- a/qmp.c
+++ b/qmp.c
@@ -651,7 +651,7 @@ void object_add(const char *type, const char *id, const QDict *qdict,
}
}
- object_property_add_child(container_get(object_get_root(), "/objects"),
+ object_property_add_child(object_get_objects_root(),
id, obj, &local_err);
if (local_err) {
goto out;
@@ -659,7 +659,7 @@ void object_add(const char *type, const char *id, const QDict *qdict,
user_creatable_complete(obj, &local_err);
if (local_err) {
- object_property_del(container_get(object_get_root(), "/objects"),
+ object_property_del(object_get_objects_root(),
id, &error_abort);
goto out;
}
@@ -706,7 +706,7 @@ void qmp_object_del(const char *id, Error **errp)
Object *container;
Object *obj;
- container = container_get(object_get_root(), "/objects");
+ container = object_get_objects_root();
obj = object_resolve_path_component(container, id);
if (!obj) {
error_setg(errp, "object id not found");