[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/7] ram: Unfold get_xbzrle_cache_stats() into popula
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 1/7] ram: Unfold get_xbzrle_cache_stats() into populate_ram_info() |
Date: |
Wed, 7 Jun 2017 11:59:20 +0200 |
They were called consecutively always.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
migration/migration.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 48c94c9..b1e68c0 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -588,20 +588,6 @@ static bool migration_is_setup_or_active(int state)
}
}
-static void get_xbzrle_cache_stats(MigrationInfo *info)
-{
- if (migrate_use_xbzrle()) {
- info->has_xbzrle_cache = true;
- info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache));
- info->xbzrle_cache->cache_size = migrate_xbzrle_cache_size();
- info->xbzrle_cache->bytes = xbzrle_mig_bytes_transferred();
- info->xbzrle_cache->pages = xbzrle_mig_pages_transferred();
- info->xbzrle_cache->cache_miss = xbzrle_mig_pages_cache_miss();
- info->xbzrle_cache->cache_miss_rate = xbzrle_mig_cache_miss_rate();
- info->xbzrle_cache->overflow = xbzrle_mig_pages_overflow();
- }
-}
-
static void populate_ram_info(MigrationInfo *info, MigrationState *s)
{
info->has_ram = true;
@@ -619,6 +605,17 @@ static void populate_ram_info(MigrationInfo *info,
MigrationState *s)
info->ram->postcopy_requests = ram_postcopy_requests();
info->ram->page_size = qemu_target_page_size();
+ if (migrate_use_xbzrle()) {
+ info->has_xbzrle_cache = true;
+ info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache));
+ info->xbzrle_cache->cache_size = migrate_xbzrle_cache_size();
+ info->xbzrle_cache->bytes = xbzrle_mig_bytes_transferred();
+ info->xbzrle_cache->pages = xbzrle_mig_pages_transferred();
+ info->xbzrle_cache->cache_miss = xbzrle_mig_pages_cache_miss();
+ info->xbzrle_cache->cache_miss_rate = xbzrle_mig_cache_miss_rate();
+ info->xbzrle_cache->overflow = xbzrle_mig_pages_overflow();
+ }
+
if (s->state != MIGRATION_STATUS_COMPLETED) {
info->ram->remaining = ram_bytes_remaining();
info->ram->dirty_pages_rate = ram_dirty_pages_rate();
@@ -664,7 +661,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->cpu_throttle_percentage = cpu_throttle_get_percentage();
}
- get_xbzrle_cache_stats(info);
break;
case MIGRATION_STATUS_POSTCOPY_ACTIVE:
/* Mostly the same as active; TODO add some postcopy stats */
@@ -687,15 +683,12 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->disk->total = blk_mig_bytes_total();
}
- get_xbzrle_cache_stats(info);
break;
case MIGRATION_STATUS_COLO:
info->has_status = true;
/* TODO: display COLO specific information (checkpoint info etc.) */
break;
case MIGRATION_STATUS_COMPLETED:
- get_xbzrle_cache_stats(info);
-
info->has_status = true;
info->has_total_time = true;
info->total_time = s->total_time;
--
2.9.4
- [Qemu-devel] [PULL 0/7] Migration PULL requset, Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 1/7] ram: Unfold get_xbzrle_cache_stats() into populate_ram_info(),
Juan Quintela <=
- [Qemu-devel] [PULL 2/7] ram: We only print throttling information sometimes, Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 3/7] ram: Call migration_page_queue_free() at ram_migration_cleanup(), Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 4/7] ram: Move ZERO_TARGET_PAGE inside XBZRLE, Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 6/7] ram: Make RAMState dynamic, Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 5/7] ram: Use MigrationStats for statistics, Juan Quintela, 2017/06/07
- [Qemu-devel] [PULL 7/7] qemu/migration: fix the double free problem on from_src_file, Juan Quintela, 2017/06/07
- Re: [Qemu-devel] [PULL 0/7] Migration PULL requset, Peter Maydell, 2017/06/07