Skip to content

Commit fa8b66c

Browse files
amit3smstsirkin
authored andcommitted
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: [email protected] # Only for 3.3 Signed-off-by: Amit Shah <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 0e93b4b commit fa8b66c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/char/virtio_console.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev)
18951895

18961896
/* Get port open/close status on the host */
18971897
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);
18981905
}
18991906
return 0;
19001907
}

0 commit comments

Comments
 (0)