aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-03-14 18:10:16 +0100
committerJuan Quintela <quintela@redhat.com>2017-04-21 12:25:38 +0200
commitabbf1d7f9bb43ba5fac7a9c27b67d9a78749e67a (patch)
tree7f133a9375ecc0203f7ced4b384348eb5cf209a7 /migration
parent42d219d3b0211c00432c04658dc22da66785f062 (diff)
ram: Remove dirty_bytes_rate
It can be recalculated from dirty_pages_rate. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> -- Dave was the one that reviewed it O:-)
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c6
-rw-r--r--migration/ram.c1
2 files changed, 3 insertions, 4 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 94647a81e3..dcf9b944cc 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1118,7 +1118,6 @@ MigrationState *migrate_init(const MigrationParams *params)
s->downtime = 0;
s->expected_downtime = 0;
s->dirty_pages_rate = 0;
- s->dirty_bytes_rate = 0;
s->setup_time = 0;
s->start_postcopy = false;
s->postcopy_after_devices = false;
@@ -2008,8 +2007,9 @@ static void *migration_thread(void *opaque)
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;
+ if (s->dirty_pages_rate && transferred_bytes > 10000) {
+ s->expected_downtime = s->dirty_pages_rate *
+ (1ul << qemu_target_page_bits()) / bandwidth;
}
qemu_file_reset_rate_limit(s->to_dst_file);
diff --git a/migration/ram.c b/migration/ram.c
index 1580617b38..ef4f508b6c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -728,7 +728,6 @@ static void migration_bitmap_sync(RAMState *rs)
}
s->dirty_pages_rate = rs->num_dirty_pages_period * 1000
/ (end_time - rs->time_last_bitmap_sync);
- s->dirty_bytes_rate = s->dirty_pages_rate * TARGET_PAGE_SIZE;
rs->time_last_bitmap_sync = end_time;
rs->num_dirty_pages_period = 0;
}