Merge remote-tracking branch 'amit/master' into staging
* amit/master: virtio-console: Fix failure on unconnected pty
This commit is contained in:
commit
f40b7d113d
|
@ -163,7 +163,19 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
if (ret == -EAGAIN || (ret >= 0 && ret < buf_size)) {
|
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);
|
virtio_serial_throttle_port(port, true);
|
||||||
|
}
|
||||||
port->iov_idx = i;
|
port->iov_idx = i;
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
port->iov_offset += ret;
|
port->iov_offset += ret;
|
||||||
|
|
Loading…
Reference in a new issue