aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-27 15:38:19 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-02 09:28:56 +0100
commitfffbd9cf1befa256d75bc45541adca405bb65dd5 (patch)
treeabfed1f45d6cc8907b19549a37916267b428c54c /qemu-char.c
parentfa778fffdfafce811bba3dd97de41fb524b861f7 (diff)
downloadqemu-fffbd9cf1befa256d75bc45541adca405bb65dd5.zip
qemu-fffbd9cf1befa256d75bc45541adca405bb65dd5.tar.gz
qemu-fffbd9cf1befa256d75bc45541adca405bb65dd5.tar.bz2
qemu-char: do not forward events through the mux until QEMU has started
Otherwise, the CHR_EVENT_OPENED event is sent twice: first when the backend (for example "stdio") is opened, and second after processing the command line. The incorrect sending of the event prints the monitor banner when QEMU is started with "-serial mon:stdio". This includes the "(qemu)" prompt; thus the monitor seems to be dead, whereas actually the active front-end is the serial port. Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Tested-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 1e5a0e8..2c9940c 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -735,19 +735,23 @@ static void mux_chr_read(void *opaque, const uint8_t *buf, int size)
}
}
+static bool muxes_realized;
+
static void mux_chr_event(void *opaque, int event)
{
CharDriverState *chr = opaque;
MuxDriver *d = chr->opaque;
int i;
+ if (!muxes_realized) {
+ return;
+ }
+
/* Send the event to all registered listeners */
for (i = 0; i < d->mux_cnt; i++)
mux_chr_send_event(d, i, event);
}
-static bool muxes_realized;
-
/**
* Called after processing of default and command-line-specified
* chardevs to deliver CHR_EVENT_OPENED events to any FEs attached