migration: calculate end time after we have sent the data
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wasserman <owasserm@redhat.com>
This commit is contained in:
parent
cc283e3bf0
commit
a3e879cd51
|
@ -673,7 +673,7 @@ static void *buffered_file_thread(void *opaque)
|
||||||
qemu_mutex_unlock_iothread();
|
qemu_mutex_unlock_iothread();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int64_t current_time = qemu_get_clock_ms(rt_clock);
|
int64_t current_time;
|
||||||
uint64_t pending_size;
|
uint64_t pending_size;
|
||||||
|
|
||||||
qemu_mutex_lock_iothread();
|
qemu_mutex_lock_iothread();
|
||||||
|
@ -727,6 +727,7 @@ static void *buffered_file_thread(void *opaque)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qemu_mutex_unlock_iothread();
|
qemu_mutex_unlock_iothread();
|
||||||
|
current_time = qemu_get_clock_ms(rt_clock);
|
||||||
if (current_time >= initial_time + BUFFER_DELAY) {
|
if (current_time >= initial_time + BUFFER_DELAY) {
|
||||||
uint64_t transferred_bytes = s->bytes_xfer;
|
uint64_t transferred_bytes = s->bytes_xfer;
|
||||||
uint64_t time_spent = current_time - initial_time;
|
uint64_t time_spent = current_time - initial_time;
|
||||||
|
|
Loading…
Reference in a new issue