qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, kraxel@redhat.com,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] char: update read handler in all cases
Date: Mon,  3 Oct 2016 13:47:03 +0400	[thread overview]
Message-ID: <20161003094704.18087-2-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20161003094704.18087-1-marcandre.lureau@redhat.com>

In commit ac1b84dd1 (rhbz#1027181), a check was added to only update the
"read handler" when the front-end is opened, because the read callbacks
were not restored when a device is plugged. However, this seems not
correct, the handler is correctly set back on hotplug (in
virtconsole_realize) and the bug can no longer be reproduced.

Calling chr_update_read_handler() allows to fix the mux driver to stop
calling the child handlers (which may be going to be destroyed).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qemu-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index fb456ce..f7a07e6 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -468,7 +468,7 @@ void qemu_chr_add_handlers_full(CharDriverState *s,
     s->chr_read = fd_read;
     s->chr_event = fd_event;
     s->handler_opaque = opaque;
-    if (fe_open && s->chr_update_read_handler) {
+    if (s->chr_update_read_handler) {
         s->chr_update_read_handler(s, context);
     }
 
-- 
2.10.0

  reply	other threads:[~2016-10-03  9:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-03  9:47 [Qemu-devel] [PATCH 0/2] Fix use after free with mux Marc-André Lureau
2016-10-03  9:47 ` Marc-André Lureau [this message]
2016-10-03  9:47 ` [Qemu-devel] [PATCH 2/2] char: use a fixed idx for child muxed chr Marc-André Lureau
2016-10-11 12:20   ` Claudio Imbrenda
2016-10-11 14:28     ` Marc-André Lureau
2016-10-11 16:18       ` Marc-André Lureau
2016-10-11 16:44         ` Daniel P. Berrange
2016-10-12  9:03           ` Marc-André Lureau
2016-10-03  9:56 ` [Qemu-devel] [PATCH 0/2] Fix use after free with mux Paolo Bonzini
2016-10-03 10:08   ` Marc-André Lureau

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=20161003094704.18087-2-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=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).