qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 24/30] qemu-char: do not forward events through the mux until QEMU has started
Date: Tue,  1 Nov 2016 17:29:37 +0100	[thread overview]
Message-ID: <1478017783-7703-25-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1478017783-7703-1-git-send-email-pbonzini@redhat.com>

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>
---
 qemu-char.c | 8 ++++++--
 1 file 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
-- 
2.7.4

  parent reply	other threads:[~2016-11-01 16:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01 16:29 [Qemu-devel] [PULL v2 00/30] Misc patches for 2016-10-31 Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 01/30] checkpatch: tweak "struct should normally be const" warning Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 02/30] nbd: Use CoQueue for free_sema instead of CoMutex Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 03/30] qemu-error: remove dependency of stubs on monitor Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 04/30] tests: send error_report to test log Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 05/30] exec.c: ensure all AddressSpaceDispatch updates under RCU Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 06/30] exec.c: do not truncate non-empty memory backend file Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 07/30] exec.c: check memory backend file size with 'size' option Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 08/30] nbd: Add qemu-nbd -D for human-readable description Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 09/30] nbd: Treat flags vs. command type as separate fields Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 10/30] nbd: Rename NBDRequest to NBDRequestData Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 11/30] nbd: Rename NbdClientSession to NBDClientSession Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 12/30] nbd: Rename struct nbd_request and nbd_reply Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 13/30] nbd: Share common reply-sending code in server Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 14/30] nbd: Send message along with server NBD_REP_ERR errors Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 15/30] nbd: Share common option-sending code in client Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 16/30] nbd: Let server know when client gives up negotiation Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 17/30] nbd: Let client skip portions of server reply Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 18/30] nbd: Less allocation during NBD_OPT_LIST Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 19/30] nbd: Support shorter handshake Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 20/30] nbd: Refactor conversion to errno to silence checkpatch Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 21/30] nbd: Improve server handling of shutdown requests Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 22/30] nbd: Implement NBD_CMD_WRITE_ZEROES on server Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 23/30] nbd: Implement NBD_CMD_WRITE_ZEROES on client Paolo Bonzini
2016-11-01 16:29 ` Paolo Bonzini [this message]
2016-11-01 16:29 ` [Qemu-devel] [PULL 25/30] slirp: fix CharDriver breakage Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 26/30] x86: add AVX512_4VNNIW and AVX512_4FMAPS features Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 27/30] checkpatch: allow spaces before parenthesis for 'coroutine_fn' Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 28/30] vl: exit qemu on guest panic if -no-shutdown is not set Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 29/30] docs/rcu.txt: Fix minor typo Paolo Bonzini
2016-11-01 16:29 ` [Qemu-devel] [PULL 30/30] main-loop: Suppress I/O thread warning under qtest Paolo Bonzini
2016-11-01 17:39 ` [Qemu-devel] [PULL v2 00/30] Misc patches for 2016-10-31 no-reply
2016-11-01 18:09 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478017783-7703-25-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).