aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2012-04-25 05:10:39 -0400
committerMichael S. Tsirkin <mst@redhat.com>2012-05-17 05:14:33 -0400
commitfa8b66ccd2d200b64496cfedcce90bf54fe7d6e9 (patch)
tree11a35ac8a4739bae2225676abeab175ec8c1d160 /drivers/char
parent0e93b4b304ae052ba1bc73f6d34a68556fe93429 (diff)
virtio: console: tell host of open ports after resume from s3/s4
If a port was open before going into one of the sleep states, the port can continue normal operation after restore. However, the host has to be told that the guest side of the connection is open to restore pre-suspend state. This wasn't noticed so far due to a bug in qemu that was fixed recently (which marked the guest-side connection as always open). CC: stable@vger.kernel.org # Only for 3.3 Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/virtio_console.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index ddf86b6500b..cdf2f5451c7 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev)
1895 1895
1896 /* Get port open/close status on the host */ 1896 /* Get port open/close status on the host */
1897 send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); 1897 send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1);
1898
1899 /*
1900 * If a port was open at the time of suspending, we
1901 * have to let the host know that it's still open.
1902 */
1903 if (port->guest_connected)
1904 send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1);
1898 } 1905 }
1899 return 0; 1906 return 0;
1900} 1907}