qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC]  virtio-console fails on unconnected pty
@ 2011-12-15 12:44 Christian Borntraeger
  2011-12-16  9:23 ` Amit Shah
  2011-12-29 12:47 ` [Qemu-devel] [PATCHv2] Fix virtio-console failure " Christian Borntraeger
  0 siblings, 2 replies; 17+ messages in thread
From: Christian Borntraeger @ 2011-12-15 12:44 UTC (permalink / raw)
  To: Amit Shah; +Cc: qemu-devel@nongnu.org, Alexander Graf

Amit,

when I tried qemu with -virtio-console pty the guest hangs and attaching on /dev/pts/<x> does
not return anything if the attachement is too late.
Turns out that the console is already throttled and the guest is heavily spinning but get_buf
never returns the buffer. There seems to be no way for the console to unthrottle the port.

For the virtio-serial use case we dont want to loose data but for the console we better drop 
data instead of "killing" the guest console. The old serial console also drops data after a 
retry, so what about dropping data righ away if no listener is connected to the pty?

This experimental patch seems to help. Makes sense?

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -163,7 +163,9 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
                 abort();
             }
             if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) {
-                virtio_serial_throttle_port(port, true);
+                if (!info->is_console) {
+                    virtio_serial_throttle_port(port, true);
+                }
                 port->iov_idx = i;
                 if (ret > 0) {
                     port->iov_offset += ret;

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

end of thread, other threads:[~2012-01-03 15:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-15 12:44 [Qemu-devel] [RFC] virtio-console fails on unconnected pty Christian Borntraeger
2011-12-16  9:23 ` Amit Shah
2011-12-29 12:47 ` [Qemu-devel] [PATCHv2] Fix virtio-console failure " Christian Borntraeger
2011-12-29 13:27   ` Amit Shah
2011-12-29 13:39     ` Andreas Färber
2011-12-29 14:04   ` Amit Shah
2011-12-29 14:16     ` Christian Borntraeger
2011-12-29 14:19       ` Christian Borntraeger
2011-12-29 14:26       ` Amit Shah
2011-12-29 14:32         ` Christian Borntraeger
2011-12-29 14:56           ` Amit Shah
2011-12-29 15:14             ` Christian Borntraeger
2011-12-29 15:14           ` Amit Shah
2012-01-02 15:34             ` Alexander Graf
2012-01-02 15:41               ` Christian Borntraeger
2012-01-02 16:55                 ` Alexander Graf
2012-01-03 15:49                   ` Amit Shah

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