Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6k1X-00064B-RH for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:24 -0400 Received: from [140.186.70.92] (port=51348 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6k1W-00063J-B3 for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6k1V-0002nf-5D for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32351) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6k1U-0002nW-Tz for qemu-devel@nongnu.org; Tue, 27 Apr 2010 08:36:21 -0400 From: Amit Shah Date: Tue, 27 Apr 2010 18:04:04 +0530 Message-Id: <1272371652-23087-11-git-send-email-amit.shah@redhat.com> In-Reply-To: <1272371652-23087-10-git-send-email-amit.shah@redhat.com> References: <1272371652-23087-1-git-send-email-amit.shah@redhat.com> <1272371652-23087-2-git-send-email-amit.shah@redhat.com> <1272371652-23087-3-git-send-email-amit.shah@redhat.com> <1272371652-23087-4-git-send-email-amit.shah@redhat.com> <1272371652-23087-5-git-send-email-amit.shah@redhat.com> <1272371652-23087-6-git-send-email-amit.shah@redhat.com> <1272371652-23087-7-git-send-email-amit.shah@redhat.com> <1272371652-23087-8-git-send-email-amit.shah@redhat.com> <1272371652-23087-9-git-send-email-amit.shah@redhat.com> <1272371652-23087-10-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH v6 10/18] virtio-serial: Send out guest data to ports only if port is opened List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Amit Shah , qemu list , Juan Quintela Data should be written only when ports are open. Signed-off-by: Amit Shah --- 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