virtio-serial-bus: Maintain guest and host port open/close state

Via control channel messages, the guest can tell us whether a port got
opened or closed. Similarly, we can also indicate to the guest of host
port open/close events.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Amit Shah 2010-01-20 00:36:53 +05:30 committed by Anthony Liguori
parent 98b19252cf
commit 6663a1956e
2 changed files with 100 additions and 0 deletions

View file

@ -49,6 +49,7 @@ struct virtio_console_control {
#define VIRTIO_CONSOLE_PORT_READY 0
#define VIRTIO_CONSOLE_CONSOLE_PORT 1
#define VIRTIO_CONSOLE_RESIZE 2
#define VIRTIO_CONSOLE_PORT_OPEN 3
/* == In-qemu interface == */
@ -92,6 +93,11 @@ struct VirtIOSerialPort {
/* Identify if this is a port that binds with hvc in the guest */
uint8_t is_console;
/* Is the corresponding guest device open? */
bool guest_connected;
/* Is this device open for IO on the host? */
bool host_connected;
};
struct VirtIOSerialPortInfo {