/* Called by main(), after creating QemuConsoles and before initializing ui (sdl/vnc/...).  */
DisplayState* init_displaystate(void)
/* Called by main(), after creating QemuConsoles and before initializing ui (sdl/vnc/...).  */
DisplayState* init_displaystate(void)
{
    Error *local_err = NULL;
    gchar *name;
    int i;
    if (!display_state) {
        display_state = g_new0(DisplayState, 1);
    }
    for (i = 0; i < nb_consoles; i++) {
        if (consoles[i]->console_type != GRAPHIC_CONSOLE &&
            consoles[i]->ds == NULL) {
            text_console_do_init(consoles[i]->chr, display_state);
        }
        name = g_strdup_printf("console[%d]", i);
        object_property_add_child(container_get(object_get_root(), "/backend"),
                                  name, OBJECT(consoles[i]), &local_err);
        g_free(name);
    }
    return display_state;
}