qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.1] qemu-char: ignore flow control if a PTY's slave is not connected
@ 2014-07-24 14:09 Paolo Bonzini
  2014-07-24 15:42 ` Pavel Hrdina
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2014-07-24 14:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: phrdina, batuzovk

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 <pbonzini@redhat.com>
---
 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)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.1] qemu-char: ignore flow control if a PTY's slave is not connected
  2014-07-24 14:09 [Qemu-devel] [PATCH for-2.1] qemu-char: ignore flow control if a PTY's slave is not connected Paolo Bonzini
@ 2014-07-24 15:42 ` Pavel Hrdina
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Hrdina @ 2014-07-24 15:42 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: batuzovk

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 <pbonzini@redhat.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-24 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-24 14:09 [Qemu-devel] [PATCH for-2.1] qemu-char: ignore flow control if a PTY's slave is not connected Paolo Bonzini
2014-07-24 15:42 ` Pavel Hrdina

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).