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.s...@redhat.com>
---
 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



Reply via email to