From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NzcQB-00046G-Nm for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:23 -0400 Received: from [140.186.70.92] (port=35093 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzcQ9-00044y-7a 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 1NzcQ7-0003C3-Nr for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45645) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NzcQ7-0003Bw-Ex for qemu-devel@nongnu.org; Wed, 07 Apr 2010 17:04:19 -0400 From: Amit Shah Date: Thu, 8 Apr 2010 02:32:29 +0530 Message-Id: <1270674156-9345-2-git-send-email-amit.shah@redhat.com> In-Reply-To: <1270674156-9345-1-git-send-email-amit.shah@redhat.com> References: <1270674156-9345-1-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 1/8] virtio-serial: throttling: check for throttled status before sending any data List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Paul Brook , "Michael S. Tsirkin" , Gerd Hoffmann , Juan Quintela We were assuming that once unthrottled, ports could accept any amount of data without getting throttled again. Fix this assumption. Signed-off-by: Amit Shah --- hw/virtio-serial-bus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 65ab253..5df9b6b 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -118,7 +118,7 @@ static void flush_queued_data(VirtIOSerialPort *port, bool discard) VirtQueueElement elem; vq = port->ovq; - while (virtqueue_pop(vq, &elem)) { + while ((discard || !port->throttled) && virtqueue_pop(vq, &elem)) { uint8_t *buf; size_t ret, buf_size; -- 1.6.2.5