From 7c47c4ead75d0b733ee8f2f51fd1de0644cc1308 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 28 Sep 2017 10:59:54 +0800 Subject: qom: provide root container for internal objs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have object_get_objects_root() to keep user created objects, however no place for objects that will be used internally. Create such a container for internal objects. CC: Andreas Färber CC: Markus Armbruster CC: Paolo Bonzini Suggested-by: Daniel P. Berrange Signed-off-by: Peter Xu Reviewed-by: Fam Zheng Message-id: 20170928025958.1420-2-peterx@redhat.com Signed-off-by: Stefan Hajnoczi --- qom/object.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'qom/object.c') diff --git a/qom/object.c b/qom/object.c index 3e18537..6a7bd92 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1370,6 +1370,17 @@ Object *object_get_objects_root(void) return container_get(object_get_root(), "/objects"); } +Object *object_get_internal_root(void) +{ + static Object *internal_root; + + if (!internal_root) { + internal_root = object_new("container"); + } + + return internal_root; +} + static void object_get_child_property(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) -- cgit v1.1