summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/console.c17
-rw-r--r--ui/gtk.c6
2 files changed, 9 insertions, 14 deletions
diff --git a/ui/console.c b/ui/console.c
index fa3e658edd..ed888e55ea 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1083,6 +1083,7 @@ static void kbd_send_chars(void *opaque)
void kbd_put_keysym_console(QemuConsole *s, int keysym)
{
uint8_t buf[16], *q;
+ CharBackend *be;
int c;
if (!s || (s->console_type == GRAPHIC_CONSOLE))
@@ -1125,7 +1126,8 @@ void kbd_put_keysym_console(QemuConsole *s, int keysym)
if (s->echo) {
console_puts(s->chr, buf, q - buf);
}
- if (s->chr->chr_read) {
+ be = s->chr->be;
+ if (be && be->chr_read) {
qemu_fifo_write(&s->out_fifo, buf, q - buf);
kbd_send_chars(s);
}
@@ -2033,8 +2035,6 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
}
qemu_chr_be_generic_open(chr);
- if (chr->init)
- chr->init(chr);
}
static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
@@ -2079,10 +2079,6 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
s->chr = chr;
chr->opaque = s;
chr->chr_set_echo = text_console_set_echo;
- /* console/chardev init sometimes completes elsewhere in a 2nd
- * stage, so defer OPENED events until they are fully initialized
- */
- chr->explicit_be_open = true;
if (display_state) {
text_console_do_init(chr, display_state);
@@ -2093,8 +2089,13 @@ static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
static VcHandler *vc_handler = text_console_init;
static CharDriverState *vc_init(const char *id, ChardevBackend *backend,
- ChardevReturn *ret, Error **errp)
+ ChardevReturn *ret, bool *be_opened,
+ Error **errp)
{
+ /* console/chardev init sometimes completes elsewhere in a 2nd
+ * stage, so defer OPENED events until they are fully initialized
+ */
+ *be_opened = false;
return vc_handler(backend->u.vc.data, errp);
}
diff --git a/ui/gtk.c b/ui/gtk.c
index 58d20eed62..25e6d9969d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1685,9 +1685,6 @@ static CharDriverState *gd_vc_handler(ChardevVC *vc, Error **errp)
/* Temporary, until gd_vc_vte_init runs. */
chr->opaque = g_new0(VirtualConsole, 1);
- /* defer OPENED events until our vc is fully initialized */
- chr->explicit_be_open = true;
-
vcs[nb_vcs++] = chr;
return chr;
@@ -1789,9 +1786,6 @@ static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc,
gtk_label_new(vc->label));
qemu_chr_be_generic_open(vc->vte.chr);
- if (vc->vte.chr->init) {
- vc->vte.chr->init(vc->vte.chr);
- }
return group;
}