uint64_t last_update;
uint64_t update_interval;
bool refreshing;
+ bool initialized;
QLIST_HEAD(, DisplayChangeListener) listeners;
NotifierList console_notifiers;
}
}
+static void qemu_console_add_to_qom(QemuConsole *con)
+{
+ g_autofree gchar *name = g_strdup_printf("console[%d]", con->index);
+ object_property_add_child(object_get_container("backend"),
+ name, OBJECT(con));
+}
+
static void
qemu_console_register(QemuConsole *c)
{
}
}
}
+
+ if (c->ds->initialized) {
+ qemu_console_add_to_qom(c);
+ }
}
static void
*/
DisplayState *init_displaystate(void)
{
- gchar *name;
+ DisplayState *ds = get_alloc_displaystate();
QemuConsole *con;
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(object_get_container("backend"),
- name, OBJECT(con));
- g_free(name);
+ qemu_console_add_to_qom(con);
}
- return display_state;
+ ds->initialized = true;
+
+ return ds;
}
void qemu_graphic_console_set_hwops(QemuConsole *con,