[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/14] ram: Print block stats also in the complete ca
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 03/14] ram: Print block stats also in the complete case |
Date: |
Tue, 13 Jun 2017 11:51:09 +0200 |
Once there, create populate_disk_info.
Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
--
- create populate_disk_info instead of "abusing" populate_ram_info
---
migration/migration.c | 31 +++++++++++++------------------
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index ae087df..2f5f270 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -627,6 +627,17 @@ static void populate_ram_info(MigrationInfo *info,
MigrationState *s)
}
}
+static void populate_disk_info(MigrationInfo *info)
+{
+ if (blk_mig_active()) {
+ info->has_disk = true;
+ info->disk = g_malloc0(sizeof(*info->disk));
+ info->disk->transferred = blk_mig_bytes_transferred();
+ info->disk->remaining = blk_mig_bytes_remaining();
+ info->disk->total = blk_mig_bytes_total();
+ }
+}
+
MigrationInfo *qmp_query_migrate(Error **errp)
{
MigrationInfo *info = g_malloc0(sizeof(*info));
@@ -652,15 +663,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->setup_time = s->setup_time;
populate_ram_info(info, s);
-
- if (blk_mig_active()) {
- info->has_disk = true;
- info->disk = g_malloc0(sizeof(*info->disk));
- info->disk->transferred = blk_mig_bytes_transferred();
- info->disk->remaining = blk_mig_bytes_remaining();
- info->disk->total = blk_mig_bytes_total();
- }
-
+ populate_disk_info(info);
break;
case MIGRATION_STATUS_POSTCOPY_ACTIVE:
/* Mostly the same as active; TODO add some postcopy stats */
@@ -674,15 +677,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
info->setup_time = s->setup_time;
populate_ram_info(info, s);
-
- if (blk_mig_active()) {
- info->has_disk = true;
- info->disk = g_malloc0(sizeof(*info->disk));
- info->disk->transferred = blk_mig_bytes_transferred();
- info->disk->remaining = blk_mig_bytes_remaining();
- info->disk->total = blk_mig_bytes_total();
- }
-
+ populate_disk_info(info);
break;
case MIGRATION_STATUS_COLO:
info->has_status = true;
--
2.9.4
- [Qemu-devel] [PULL 00/14] Migration PULL request, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 01/14] migration: isolate return path on src, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 03/14] ram: Print block stats also in the complete case,
Juan Quintela <=
- [Qemu-devel] [PULL 04/14] ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 05/14] migration: Remove MigrationState from migration_channel_incomming(), Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 02/14] migration: Don't try to set *errp directly, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 07/14] migration: Split registration functions from vmstate.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 08/14] migration: Move dump_vmsate_json_to_file() to misc.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 06/14] migration: Move self_announce_delay() to misc.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 09/14] migration: Move constants to savevm.h, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 10/14] migration: Commands are only used inside migration.c, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 11/14] migration: ram_control_* are implemented in qemu_file, Juan Quintela, 2017/06/13
- [Qemu-devel] [PULL 12/14] migration: create global_state.c, Juan Quintela, 2017/06/13