aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2017-03-14 18:01:38 +0100
committerJuan Quintela <quintela@redhat.com>2017-04-21 12:25:37 +0200
commit42d219d3b0211c00432c04658dc22da66785f062 (patch)
treefbc64a702f26f1eaf9e8dca8e048a7673eac26d6 /migration
parentec481c6c576fbac6c4b5a7a5874e313882a49a09 (diff)
downloadqemu-42d219d3b0211c00432c04658dc22da66785f062.zip
qemu-42d219d3b0211c00432c04658dc22da66785f062.tar.gz
qemu-42d219d3b0211c00432c04658dc22da66785f062.tar.bz2
ram: Create ram_dirty_sync_count()
This is a ram field that was inside MigrationState. Move it to RAMState and make it the same that the other ram stats. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/migration.c3
-rw-r--r--migration/ram.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 5918b21..94647a8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -656,7 +656,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
info->ram->normal_bytes = norm_mig_pages_transferred() *
(1ul << qemu_target_page_bits());
info->ram->mbps = s->mbps;
- info->ram->dirty_sync_count = s->dirty_sync_count;
+ info->ram->dirty_sync_count = ram_dirty_sync_count();
info->ram->postcopy_requests = s->postcopy_requests;
if (s->state != MIGRATION_STATUS_COMPLETED) {
@@ -1120,7 +1120,6 @@ MigrationState *migrate_init(const MigrationParams *params)
s->dirty_pages_rate = 0;
s->dirty_bytes_rate = 0;
s->setup_time = 0;
- s->dirty_sync_count = 0;
s->start_postcopy = false;
s->postcopy_after_devices = false;
s->postcopy_requests = 0;
diff --git a/migration/ram.c b/migration/ram.c
index be26d0c..1580617 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -271,6 +271,11 @@ uint64_t ram_bytes_remaining(void)
return ram_state.migration_dirty_pages * TARGET_PAGE_SIZE;
}
+uint64_t ram_dirty_sync_count(void)
+{
+ return ram_state.bitmap_sync_count;
+}
+
/* used by the search for pages to send */
struct PageSearchStatus {
/* Current block being searched */
@@ -727,7 +732,6 @@ static void migration_bitmap_sync(RAMState *rs)
rs->time_last_bitmap_sync = end_time;
rs->num_dirty_pages_period = 0;
}
- s->dirty_sync_count = rs->bitmap_sync_count;
if (migrate_use_events()) {
qapi_event_send_migration_pass(rs->bitmap_sync_count, NULL);
}