From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVXww-0001m6-KS for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVXws-0001hS-1h for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:19 -0500 Received: from [199.232.76.173] (port=51585 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVXwr-0001gq-Na for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:17 -0500 Received: from mx2.redhat.com ([66.187.237.31]:54578) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LVXwq-0007o0-Nf for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:17 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n16L9ECB001161 for ; Fri, 6 Feb 2009 16:09:14 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n16L9DnN029482 for ; Fri, 6 Feb 2009 16:09:14 -0500 Received: from blackpad.localdomain (vpn-10-11.bos.redhat.com [10.16.10.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n16L9DG6014587 for ; Fri, 6 Feb 2009 16:09:13 -0500 From: Eduardo Habkost Date: Fri, 6 Feb 2009 19:08:54 -0200 Message-Id: <1233954540-4754-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1233954540-4754-1-git-send-email-ehabkost@redhat.com> References: <1233954540-4754-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 3/9] monitor_readline: poll pending bottom halves before readline_start() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org monitor_readline() breaks when a CHR_EVENT_RESET event bottom-half is pending, because the bottom-half resets the console readline state. Call qemu_bh_poll() before readline_start() to avoid that from happening. >>From my tests, there is more monitor_readline() badness on the current code, but this should make things slightly better. Signed-off-by: Eduardo Habkost --- monitor.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/monitor.c b/monitor.c index 354a792..138e829 100644 --- a/monitor.c +++ b/monitor.c @@ -2862,6 +2862,12 @@ void monitor_readline(const char *prompt, int is_password, } } + /* Terminal reset events may be pending, and they would + * drop the setup done by the readline_start() call + * below. + */ + qemu_bh_poll(); + readline_start(prompt, is_password, monitor_readline_cb, NULL); monitor_readline_buf = buf; monitor_readline_buf_size = buf_size; -- 1.6.0.2.GIT