From: Amit Shah Date: Tue, 27 Apr 2010 12:34:04 +0000 (+0530) Subject: virtio-serial: Send out guest data to ports only if port is opened X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3ecb45f893d09a97b8f24399b5e40808a708261f;p=qemu.git 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 --- 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