diff mbox series

[05/12] ui/console: Explicitly create "/backend" container

Message ID 20241120215703.3918445-6-peterx@redhat.com (mailing list archive)
State New
Headers show
Series QOM: container_get() removal | expand

Commit Message

Peter Xu Nov. 20, 2024, 9:56 p.m. UTC
Follow the trend to explicitly create containers, do that for console.c on
"/backend" container.

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 ui/console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ui/console.c b/ui/console.c
index 5165f17125..36f8c6debb 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1154,14 +1154,14 @@  DisplayState *init_displaystate(void)
 {
     gchar *name;
     QemuConsole *con;
+    Object *backend = container_create(object_get_root(), "backend");
 
     QTAILQ_FOREACH(con, &consoles, next) {
         /* Hook up into the qom tree here (not in object_new()), once
          * all QemuConsoles are created and the order / numbering
          * doesn't change any more */
         name = g_strdup_printf("console[%d]", con->index);
-        object_property_add_child(container_get(object_get_root(), "/backend"),
-                                  name, OBJECT(con));
+        object_property_add_child(backend, name, OBJECT(con));
         g_free(name);
     }