From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHsqE-0003Xe-SK for qemu-devel@nongnu.org; Mon, 24 Feb 2014 05:33:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHsq6-0005HA-9A for qemu-devel@nongnu.org; Mon, 24 Feb 2014 05:32:54 -0500 Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:55344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHsq6-0005Gx-3t for qemu-devel@nongnu.org; Mon, 24 Feb 2014 05:32:46 -0500 Received: by mail-qg0-f46.google.com with SMTP id e89so14369948qgf.5 for ; Mon, 24 Feb 2014 02:32:45 -0800 (PST) Sender: Paolo Bonzini Message-ID: <530B1FC9.3080507@redhat.com> Date: Mon, 24 Feb 2014 11:32:41 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393237002-16980-1-git-send-email-ghammer@redhat.com> <1393237002-16980-3-git-send-email-ghammer@redhat.com> In-Reply-To: <1393237002-16980-3-git-send-email-ghammer@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] qtest: fix a "!chr->fd_in_tag" assertion error in qtest. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gal Hammer , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, peter.maydell@linaro.org, anthony@codemonkey.ws Il 24/02/2014 11:16, Gal Hammer ha scritto: > Replacement of the default chardev handlers now requires a call to > release the current handlers. > > Signed-off-by: Gal Hammer > --- > monitor.c | 1 + > qtest.c | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/monitor.c b/monitor.c > index de90fba..db52e7f 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -5024,6 +5024,7 @@ void monitor_init(CharDriverState *chr, int flags) > if (monitor_ctrl_mode(mon)) { > mon->mc = g_malloc0(sizeof(MonitorControl)); > /* Control mode requires special handlers */ > + qemu_chr_add_handlers(chr, NULL, NULL, NULL, NULL); > qemu_chr_add_handlers(chr, monitor_can_read, monitor_control_read, > monitor_control_event, mon); > qemu_chr_fe_set_echo(chr, true); > diff --git a/qtest.c b/qtest.c > index ae941d6..a5682ee 100644 > --- a/qtest.c > +++ b/qtest.c > @@ -519,6 +519,8 @@ void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp) > return; > } > > + /* Replace the default tcp's handlers with qtest's handlers. */ > + qemu_chr_add_handlers(chr, NULL, NULL, NULL, NULL); > qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr); > qemu_chr_fe_set_echo(chr, true); > > Why can't qemu_chr_add_handlers call remove_fd_in_watch when handlers are replaced, before setting the new ones? Paolo