aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2013-02-01 12:39:08 +0100
committerJuan Quintela <quintela@redhat.com>2013-02-22 10:12:52 +0100
commita3e879cd51c4f614f702117c4b1449f0218c00f3 (patch)
tree3523d520f2974a869f8a3d3acaa7c44211cc7284
parentcc283e3bf04d2f64eb6ec2ee5bcd36edd779fe89 (diff)
downloadqemu-a3e879cd51c4f614f702117c4b1449f0218c00f3.zip
qemu-a3e879cd51c4f614f702117c4b1449f0218c00f3.tar.gz
qemu-a3e879cd51c4f614f702117c4b1449f0218c00f3.tar.bz2
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>
-rw-r--r--migration.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/migration.c b/migration.c
index b3f5ba4..b8e412f 100644
--- a/migration.c
+++ b/migration.c
@@ -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();
@@ -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;