Patchwork [v2,1/4] buffered_file: reset bytes_xfer on every tick

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 20, 2012, 4:45 p.m.
Message ID <1353429936-29180-2-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/200399/
State New
Headers show

Comments

Paolo Bonzini - Nov. 20, 2012, 4:45 p.m.
Even if the socket cannot send more data right now, whenever a new
tick has started we can send xfer_limit more bytes.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 buffered_file.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Patch

diff --git a/buffered_file.c b/buffered_file.c
index bd0f61d..49e9089 100644
--- a/buffered_file.c
+++ b/buffered_file.c
@@ -233,11 +233,10 @@  static void buffered_rate_tick(void *opaque)
 
     qemu_mod_timer(s->timer, qemu_get_clock_ms(rt_clock) + 100);
 
+    s->bytes_xfer = 0;
     if (s->freeze_output)
         return;
 
-    s->bytes_xfer = 0;
-
     buffered_put_buffer(s, NULL, 0, 0);
 }