]> Git Repo - qemu.git/commitdiff
migration: use qemu_file_rate_limit consistently
authorPaolo Bonzini <[email protected]>
Fri, 22 Feb 2013 16:36:35 +0000 (17:36 +0100)
committerJuan Quintela <[email protected]>
Mon, 11 Mar 2013 12:32:02 +0000 (13:32 +0100)
Reviewed-by: Orit Wasserman <[email protected]>
Reviewed-by: Juan Quintela <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
migration.c

index 5d99999e475d69d6ce45b7aa82647223f07b149a..f35728da8d97617f82a88592a8ee855dd80846c9 100644 (file)
@@ -628,7 +628,7 @@ static void *migration_thread(void *opaque)
         int64_t current_time;
         uint64_t pending_size;
 
-        if (s->bytes_xfer < s->xfer_limit) {
+        if (!qemu_file_rate_limit(s->file)) {
             DPRINTF("iterate\n");
             pending_size = qemu_savevm_state_pending(s->file, max_size);
             DPRINTF("pending size %lu max %lu\n", pending_size, max_size);
@@ -675,7 +675,7 @@ static void *migration_thread(void *opaque)
             sleep_time = 0;
             initial_time = current_time;
         }
-        if (s->bytes_xfer >= s->xfer_limit) {
+        if (qemu_file_rate_limit(s->file)) {
             /* usleep expects microseconds */
             g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
             sleep_time += qemu_get_clock_ms(rt_clock) - current_time;
This page took 0.022936 seconds and 4 git commands to generate.