From: Laurent Vivier <lvivier@redhat.com>
To: Juan Quintela <quintela@redhat.com>, qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 1/2] ram: Print block stats also in the complete case
Date: Mon, 12 Jun 2017 13:58:54 +0200 [thread overview]
Message-ID: <d7621000-bb1f-3f83-9d02-595c7ea8fc5d@redhat.com> (raw)
In-Reply-To: <20170607105810.3003-2-quintela@redhat.com>
On 07/06/2017 12:58, Juan Quintela wrote:
> Once there, create populate_disk_info.
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
>
> --
>
> - 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;
>
next prev parent reply other threads:[~2017-06-12 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-07 10:58 [Qemu-devel] [PATCH v2 0/2] Make info migrate output consistent Juan Quintela
2017-06-07 10:58 ` [Qemu-devel] [PATCH v2 1/2] ram: Print block stats also in the complete case Juan Quintela
2017-06-12 11:52 ` Dr. David Alan Gilbert
2017-06-12 11:58 ` Laurent Vivier [this message]
2017-06-07 10:58 ` [Qemu-devel] [PATCH v2 2/2] ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE Juan Quintela
2017-06-12 11:57 ` Dr. David Alan Gilbert
2017-06-12 12:01 ` Laurent Vivier
2017-06-07 11:37 ` [Qemu-devel] [PATCH v2 0/2] Make info migrate output consistent Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d7621000-bb1f-3f83-9d02-595c7ea8fc5d@redhat.com \
--to=lvivier@redhat.com \
--cc=dgilbert@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).