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>
diff --git a/iothread.c b/iothread.c
index 878a594..6d2a33f 100644
--- a/iothread.c
+++ b/iothread.c
@@ -19,8 +19,6 @@
 #include "qmp-commands.h"
 #include "qemu/error-report.h"
 
-#define IOTHREADS_PATH "/objects"
-
 typedef ObjectClass IOThreadClass;
 
 #define IOTHREAD_GET_CLASS(obj) \
@@ -160,7 +158,7 @@
 {
     IOThreadInfoList *head = NULL;
     IOThreadInfoList **prev = &head;
-    Object *container = container_get(object_get_root(), IOTHREADS_PATH);
+    Object *container = object_get_objects_root();
 
     object_child_foreach(container, query_one_iothread, &prev);
     return head;