From patchwork Wed Apr 7 21:02:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 49644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F923B7D21 for ; Thu, 8 Apr 2010 07:11:43 +1000 (EST) Received: from localhost ([127.0.0.1]:34557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzcVG-0005GL-5j for incoming@patchwork.ozlabs.org; Wed, 07 Apr 2010 17:09:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzcQC-00046Q-0m for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:24 -0400 Received: from [140.186.70.92] (port=35100 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzcQA-00045a-80 for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NzcQ8-0003CB-5G for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzcQ7-0003Bz-T5 for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:20 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o37L4C4D016449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 7 Apr 2010 17:04:12 -0400 Received: from localhost (vpn-252-12.phx2.redhat.com [10.3.252.12]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o37L4AZq026563; Wed, 7 Apr 2010 17:04:11 -0400 From: Amit Shah To: qemu list Date: Thu, 8 Apr 2010 02:32:30 +0530 Message-Id: <1270674156-9345-3-git-send-email-amit.shah@redhat.com> In-Reply-To: <1270674156-9345-2-git-send-email-amit.shah@redhat.com> References: <1270674156-9345-1-git-send-email-amit.shah@redhat.com> <1270674156-9345-2-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Amit Shah , Paul Brook , "Michael S. Tsirkin" , Gerd Hoffmann , Juan Quintela Subject: [Qemu-devel] [PATCH 2/8] virtio-serial: Unthrottle ports once they're closed X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Disable throttling once a port is closed (and we discard all the unconsumed buffers in the vq). Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 5df9b6b..8d77c94 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -190,8 +190,9 @@ int virtio_serial_close(VirtIOSerialPort *port) /* * If there's any data the guest sent which the app didn't - * consume, discard it. + * consume, reset the throttling flag and discard the data. */ + port->throttled = false; flush_queued_data(port, true); return 0; }