diff mbox

[1/8] virtio-serial: throttling: check for throttled status before sending any data

Message ID 1270674156-9345-2-git-send-email-amit.shah@redhat.com
State New
Headers show

Commit Message

Amit Shah April 7, 2010, 9:02 p.m. UTC
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 <amit.shah@redhat.com>
---
 hw/virtio-serial-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

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;