All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Juan Quintela <quintela@redhat.com>
Cc: qemu-devel@nongnu.org, jcody@redhat.com, kwolf@redhat.com,
	kashyap@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block migration: Allow compile time disable
Date: Mon, 15 May 2017 14:02:03 +0100	[thread overview]
Message-ID: <20170515130202.GG2089@work-vm> (raw)
In-Reply-To: <87pofpizmj.fsf@secure.mitica>

* Juan Quintela (quintela@redhat.com) wrote:
> "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com> wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Many users now prefer to use drive_mirror over NBD as an
> > alternative to the older migrate -b option; drive_mirror is
> > more complex to setup but gives you more options (e.g. only
> > migrating some of the disks if some of them are shared).
> >
> > Allow the large chunk of block migration code to be compiled
> > out for those who don't use it.
> >
> > Based on a downstream-patch we've had for a while by Jeff Cody.
> >
> > Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> Reviewed-by: Juan Quintela <quintela@redhat.com>
> 
> > diff --git a/migration/migration.c b/migration/migration.c
> > index 353f2728cf..ffce72aabc 100644
> > --- a/migration/migration.c
> > +++ b/migration/migration.c
> > @@ -692,6 +692,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
> >  
> >          populate_ram_info(info, s);
> >  
> > +#ifdef CONFIG_LIVE_BLOCK_MIGRATION
> >          if (blk_mig_active()) {
> >              info->has_disk = true;
> >              info->disk = g_malloc0(sizeof(*info->disk));
> > @@ -699,6 +700,7 @@ MigrationInfo *qmp_query_migrate(Error **errp)
> >              info->disk->remaining = blk_mig_bytes_remaining();
> >              info->disk->total = blk_mig_bytes_total();
> >          }
> > +#endif
> 
> I think it can be cleaner to move this inside block.c and just export a
> function that is empty in case it is compiled out, but that it is just
> me, so you got the revieweb by anyways.
> 
> >          }
> >      }
> >  
> > +#ifdef CONFIG_LIVE_BLOCK_MIGRATION
> >      blk_mig_init();
> > +#endif
> >      ram_mig_init();
> >  
> >      /* If the currently selected machine wishes to override the units-per-bus
> 
> Same here, I preffer the ifdef in the header than here.

OK, done I've now got the block.h header having:
#ifdef CONFIG_LIVE_BLOCK_MIGRATION
void blk_mig_init(void);
int blk_mig_active(void);
uint64_t blk_mig_bytes_transferred(void);
uint64_t blk_mig_bytes_remaining(void);
uint64_t blk_mig_bytes_total(void);

#else
static inline void blk_mig_init(void) { };
static inline int blk_mig_active(void)
{
    return false;
}
static inline uint64_t blk_mig_bytes_transferred(void)
{
    return 0;
}

static inline uint64_t blk_mig_bytes_remaining(void)
{
    return 0;
}

static inline uint64_t blk_mig_bytes_total(void)
{
    return 0;
}
#endif /* CONFIG_LIVE_BLOCK_MIGRATION */

Dave

> Later, Juan.
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2017-05-15 13:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 10:42 [Qemu-devel] [PATCH] block migration: Allow compile time disable Dr. David Alan Gilbert (git)
2017-05-03 18:06 ` Juan Quintela
2017-05-15 13:02   ` Dr. David Alan Gilbert [this message]
2017-05-15 13:09     ` Juan Quintela
2017-05-04 10:08 ` Kashyap Chamarthy
2017-05-04 10:25   ` Dr. David Alan Gilbert
2017-05-04 12:52     ` Kashyap Chamarthy
2017-05-15 13:24   ` Dr. David Alan Gilbert
2017-05-04 16:30 ` Eric Blake
2017-05-15 12:13   ` Dr. David Alan Gilbert
2017-05-15 13:44     ` 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=20170515130202.GG2089@work-vm \
    --to=dgilbert@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kashyap@redhat.com \
    --cc=kwolf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.