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

* amit/master:
  virtio-console: Fix failure on unconnected pty
This commit is contained in:
Anthony Liguori 2012-01-06 08:15:39 -06:00
commit f40b7d113d
1 changed files with 13 additions and 1 deletions

View File

@ -163,7 +163,19 @@ 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);
/*
* 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;