From 3ecb45f893d09a97b8f24399b5e40808a708261f Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Tue, 27 Apr 2010 18:04:04 +0530 Subject: [PATCH] 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 Signed-off-by: Anthony Liguori --- hw/virtio-serial-bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 3a09f0d3c6..6befd4d139 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -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