From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbAgE-0006RS-JO for qemu-devel@nongnu.org; Thu, 15 Dec 2011 07:45:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbAgA-0003DC-Q4 for qemu-devel@nongnu.org; Thu, 15 Dec 2011 07:44:58 -0500 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:52238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbAgA-0003Cr-HE for qemu-devel@nongnu.org; Thu, 15 Dec 2011 07:44:54 -0500 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Dec 2011 12:44:46 -0000 Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBFCihuF2564170 for ; Thu, 15 Dec 2011 12:44:43 GMT Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBFCih7H032452 for ; Thu, 15 Dec 2011 05:44:43 -0700 Message-ID: <4EE9EBB9.9020300@de.ibm.com> Date: Thu, 15 Dec 2011 13:44:41 +0100 From: Christian Borntraeger MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] virtio-console fails on unconnected pty List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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/ 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 --- 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;