Skip to content

Commit

Permalink
migration: calculate end time after we have sent the data
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Quintela <quintela@redhat.com>


Reviewed-by: Orit Wasserman <owasserm@redhat.com>
  • Loading branch information
Juan Quintela committed Feb 22, 2013
1 parent cc283e3 commit a3e879c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migration.c
Expand Up @@ -673,7 +673,7 @@ static void *buffered_file_thread(void *opaque)
qemu_mutex_unlock_iothread();

while (true) {
int64_t current_time = qemu_get_clock_ms(rt_clock);
int64_t current_time;
uint64_t pending_size;

qemu_mutex_lock_iothread();
Expand Down Expand Up @@ -727,6 +727,7 @@ static void *buffered_file_thread(void *opaque)
}
}
qemu_mutex_unlock_iothread();
current_time = qemu_get_clock_ms(rt_clock);
if (current_time >= initial_time + BUFFER_DELAY) {
uint64_t transferred_bytes = s->bytes_xfer;
uint64_t time_spent = current_time - initial_time;
Expand Down

0 comments on commit a3e879c

Please sign in to comment.