提交 930ac04c 编写于 作者: J Juan Quintela

ram: Print block stats also in the complete case

Once there, create populate_disk_info.
Signed-off-by: NJuan Quintela <quintela@redhat.com>
Reviewed-by: NPeter Xu <peterx@redhat.com>
Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: NLaurent Vivier <lvivier@redhat.com>

--

- create populate_disk_info instead of "abusing" populate_ram_info
上级 250561e1
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册