Commit a0ff044b authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Juan Quintela
Browse files

migration: use qemu_file_rate_limit consistently


Reviewed-by: default avatarOrit Wasserman <owasserm@redhat.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
parent db2f2530
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment