From 90f8ae724a575861f093fbdbfd49a925bcfec327 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Fri, 1 Feb 2013 13:22:37 +0100 Subject: migration: calculate expected_downtime We removed the calculation in commit e4ed1541ac9413eac494a03532e34beaf8a7d1c5 Now we add it back. We need to create dirty_bytes_rate because we can't include cpu-all.h from migration.c, and there is no other way to include TARGET_PAGE_SIZE. Signed-off-by: Juan Quintela Reviewed-by: Orit Wasserman --- migration.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'migration.c') diff --git a/migration.c b/migration.c index 6649e3a..11725ae 100644 --- a/migration.c +++ b/migration.c @@ -738,6 +738,11 @@ static void *buffered_file_thread(void *opaque) DPRINTF("transferred %" PRIu64 " time_spent %" PRIu64 " bandwidth %g max_size %" PRId64 "\n", transferred_bytes, time_spent, bandwidth, max_size); + /* if we haven't sent anything, we don't want to recalculate + 10000 is a small enough number for our purposes */ + if (s->dirty_bytes_rate && transferred_bytes > 10000) { + s->expected_downtime = s->dirty_bytes_rate / bandwidth; + } s->bytes_xfer = 0; sleep_time = 0; -- cgit v1.1