Received: from eggs.gnu.org ([2001:4830:134:3::10]:40307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqzq5-0000UU-6O for qemu-devel@nongnu.org; Mon, 03 Oct 2016 05:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqzq3-0005mD-Vr for qemu-devel@nongnu.org; Mon, 03 Oct 2016 05:47:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqzq3-0005li-Pp for qemu-devel@nongnu.org; Mon, 03 Oct 2016 05:47:11 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46C2885545 for ; Mon, 3 Oct 2016 09:47:11 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 3 Oct 2016 13:47:03 +0400 Message-Id: <20161003094704.18087-2-marcandre.lureau@redhat.com> In-Reply-To: <20161003094704.18087-1-marcandre.lureau@redhat.com> References: <20161003094704.18087-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/2] char: update read handler in all cases List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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=C3=A9 Lureau --- 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 =3D fd_read; s->chr_event =3D fd_event; s->handler_opaque =3D opaque; - if (fe_open && s->chr_update_read_handler) { + if (s->chr_update_read_handler) { s->chr_update_read_handler(s, context); } =20 --=20 2.10.0