diff options
author | Amit Shah <amit.shah@redhat.com> | 2012-04-25 14:40:39 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-21 10:46:21 -0700 |
commit | 17b85e4808e2593a234a34e629a5ae08e5246958 (patch) | |
tree | 97321922c3e980edf0f1de2e6b3c71b1e22a3200 | |
parent | c52d567fdf7fb8cdaf2d34206f5b7f4adaae1595 (diff) |
virtio: console: tell host of open ports after resume from s3/s4
commit fa8b66ccd2d200b64496cfedcce90bf54fe7d6e9 upstream.
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).
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/char/virtio_console.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index b58b56187065..41fc148d2e2c 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -1901,6 +1901,13 @@ static int virtcons_restore(struct virtio_device *vdev) /* Get port open/close status on the host */ send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); + + /* + * If a port was open at the time of suspending, we + * have to let the host know that it's still open. + */ + if (port->guest_connected) + send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); } return 0; } |