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-28 08:58:21 -05:00
committed by Anthony Liguori
parent 4048c7c321
commit 3ecb45f893
+5
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