qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Juan Quintela <quintela@redhat.com>,
	qemu-devel@nongnu.org, lvivier@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/4] ram: Print block stats also in the complete case
Date: Tue, 6 Jun 2017 15:21:43 +0800	[thread overview]
Message-ID: <20170606072143.GA27621@pxdev.xzpeter.org> (raw)
In-Reply-To: <20170602175529.GE2081@work-vm>

On Fri, Jun 02, 2017 at 06:55:30PM +0100, Dr. David Alan Gilbert wrote:
> * 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.

Agree...

Maybe rename populate_ram_info() into more general name?
migrate_info_populate()?

(Also, I think auto convergence is not RAM-related as well, so same
 comment may apply to patch 2)

Thanks,

> 
> 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

-- 
Peter Xu

  reply	other threads:[~2017-06-06  7:21 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
2017-06-06  7:21     ` Peter Xu [this message]
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=20170606072143.GA27621@pxdev.xzpeter.org \
    --to=peterx@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@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).