From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XALAa-0004vc-K0 for qemu-devel@nongnu.org; Thu, 24 Jul 2014 11:43:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XALAT-0005YU-4k for qemu-devel@nongnu.org; Thu, 24 Jul 2014 11:43:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XALAS-0005YH-QF for qemu-devel@nongnu.org; Thu, 24 Jul 2014 11:42:53 -0400 Message-ID: <53D1296A.3080500@redhat.com> Date: Thu, 24 Jul 2014 17:42:34 +0200 From: Pavel Hrdina MIME-Version: 1.0 References: <1406210963-15846-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1406210963-15846-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.1] qemu-char: ignore flow control if a PTY's slave is not connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: batuzovk@ispras.ru On 24.7.2014 16:09, Paolo Bonzini wrote: > After commit f702e62 (serial: change retry logic to avoid concurrency, > 2014-07-11), guest boot hangs if the backend is an unconnected PTY. > > The reason is that PTYs do not support G_IO_HUP, and serial_xmit is > never called. To fix this, simply invoke serial_xmit immediately > (via g_idle_source_new) when this happens. > > Signed-off-by: Paolo Bonzini > --- > qemu-char.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/qemu-char.c b/qemu-char.c > index 7acc03f..64d3473 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -1168,7 +1168,11 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len) > static GSource *pty_chr_add_watch(CharDriverState *chr, GIOCondition cond) > { > PtyCharDriver *s = chr->opaque; > - return g_io_create_watch(s->fd, cond); > + if (!s->connected) { > + return g_idle_source_new(); > + } else { > + return g_io_create_watch(s->fd, cond); > + } > } > > static int pty_chr_read_poll(void *opaque) > Sadly, it didn't fix the issue and a guest still don't boot up with serial console. Pavel