Amit Shah
2012-Apr-25 09:10 UTC
[PATCH 1/1] 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 at vger.kernel.org # Only for 3.3 Signed-off-by: Amit Shah <amit.shah at redhat.com> --- 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 ddf86b6..cdf2f54 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) /* 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; } -- 1.7.7.6
Michael S. Tsirkin
2012-Apr-25 10:37 UTC
[PATCH 1/1] virtio: console: tell host of open ports after resume from s3/s4
On Wed, Apr 25, 2012 at 02:40:39PM +0530, Amit Shah wrote:> 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 at vger.kernel.org # Only for 3.3 > > Signed-off-by: Amit Shah <amit.shah at redhat.com>Applied and queued for the next 3.4 pull, thanks.> --- > 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 ddf86b6..cdf2f54 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) > > /* 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; > } > -- > 1.7.7.6
Apparently Analagous Threads
- [PATCH 1/1] virtio: console: tell host of open ports after resume from s3/s4
- [PATCH 09/11] virtio: console: Don't always create a port 0 if using multiport
- [PATCH 09/11] virtio: console: Don't always create a port 0 if using multiport
- [PATCH 1/2] virtio: console: Fix crash when hot-unplugging a port and read is blocked
- [PATCH 1/2] virtio: console: Fix crash when hot-unplugging a port and read is blocked