qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 10/17] virtio-serial: Send out guest data to port


From: Amit Shah
Subject: [Qemu-devel] [PATCH v5 10/17] virtio-serial: Send out guest data to ports only if port is opened
Date: Wed, 14 Apr 2010 10:58:30 +0530

Data should be written only when ports are open.

Signed-off-by: Amit Shah <address@hidden>
---
 hw/virtio-serial-bus.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 3a09f0d..6befd4d 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
-- 
1.6.2.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]