diff options
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/migration.c b/migration.c index 6649e3a689..11725ae3fc 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; |