Commit f40b7d11 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'amit/master' into staging

* amit/master:
  virtio-console: Fix failure on unconnected pty
parents 74b728e4 ed8e5a85
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -163,7 +163,19 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
                abort();
            }
            if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) {
		/*
                 * this is a temporary check until chardevs can signal to
                 * frontends that they are writable again. This prevents
                 * the console from going into throttled mode (forever)
                 * if virtio-console is connected to a pty without a
                 * listener. Otherwise the guest spins forever.
                 * We can revert this if
                 * 1: chardevs can notify frondends
                 * 2: the guest driver does not spin in these cases
                 */
                if (!info->is_console) {
                    virtio_serial_throttle_port(port, true);
                }
                port->iov_idx = i;
                if (ret > 0) {
                    port->iov_offset += ret;