[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/2] ram: Print block stats also in the compl
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/2] ram: Print block stats also in the complete case |
Date: |
Mon, 12 Jun 2017 12:52:27 +0100 |
User-agent: |
Mutt/1.8.2 (2017-04-18) |
* Juan Quintela (address@hidden) wrote:
> Once there, create populate_disk_info.
>
> Signed-off-by: Juan Quintela <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <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 4dbc4f2..cfa266b 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -515,6 +515,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));
> @@ -540,15 +551,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 */
> @@ -562,15 +565,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
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK