From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org, lvivier@redhat.com, peterx@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/4] ram: Print block stats also in the complete case
Date: Fri, 2 Jun 2017 18:55:30 +0100 [thread overview]
Message-ID: <20170602175529.GE2081@work-vm> (raw)
In-Reply-To: <20170601214056.30387-4-quintela@redhat.com>
* Juan Quintela (quintela@redhat.com) wrote:
> To make things easier, I just moved it to populate_ram_info().
Blk is not RAM; better to create a separate function.
Dave
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
> migration/migration.c | 26 ++++++++------------------
> 1 file changed, 8 insertions(+), 18 deletions(-)
>
> diff --git a/migration/migration.c b/migration/migration.c
> index 7f79da0..8289544 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -509,6 +509,14 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
> info->cpu_throttle_percentage = cpu_throttle_get_percentage();
> }
>
> + 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();
> + }
> +
> if (s->state != MIGRATION_STATUS_COMPLETED) {
> info->ram->remaining = ram_bytes_remaining();
> info->ram->dirty_pages_rate = ram_dirty_pages_rate();
> @@ -540,15 +548,6 @@ 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();
> - }
> -
> break;
> case MIGRATION_STATUS_POSTCOPY_ACTIVE:
> /* Mostly the same as active; TODO add some postcopy stats */
> @@ -562,15 +561,6 @@ 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();
> - }
> -
> break;
> case MIGRATION_STATUS_COLO:
> info->has_status = true;
> --
> 2.9.4
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2017-06-02 17:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 21:40 [Qemu-devel] [PATCH 0/4] Make info migrate output consistent Juan Quintela
2017-06-01 21:40 ` [Qemu-devel] [PATCH 1/4] ram: Unfold get_xbzrle_cache_stats() into populate_ram_info() Juan Quintela
2017-06-02 13:32 ` Eric Blake
2017-06-01 21:40 ` [Qemu-devel] [PATCH 2/4] ram: We only print throttling information sometimes Juan Quintela
2017-06-02 13:33 ` Eric Blake
2017-06-01 21:40 ` [Qemu-devel] [PATCH 3/4] ram: Print block stats also in the complete case Juan Quintela
2017-06-02 13:35 ` Eric Blake
2017-06-02 17:55 ` Dr. David Alan Gilbert [this message]
2017-06-06 7:21 ` Peter Xu
2017-06-01 21:40 ` [Qemu-devel] [PATCH 4/4] ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE Juan Quintela
2017-06-02 13:36 ` Eric Blake
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=20170602175529.GE2081@work-vm \
--to=dgilbert@redhat.com \
--cc=lvivier@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).