virtio-serial: Send out guest data to ports only if port is opened

Data should be written only when ports are open.

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-04-27 18:04:04 +05:30 committed by Anthony Liguori
parent 4048c7c321
commit 3ecb45f893

View File

@ -335,6 +335,11 @@ static void handle_output(VirtIODevice *vdev, VirtQueue *vq)
goto next_buf;
}
if (!port->host_connected) {
ret = 0;
goto next_buf;
}
/*
* A port may not have any handler registered for consuming the
* data that the guest sends or it may not have a chardev associated