[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 17/29] migration: rebuild channel on source
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [RFC 17/29] migration: rebuild channel on source |
Date: |
Wed, 2 Aug 2017 14:14:43 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Tue, Aug 01, 2017 at 11:59:07AM +0100, Dr. David Alan Gilbert wrote:
> * Peter Xu (address@hidden) wrote:
> > This patch detects the "resume" flag of migration command, rebuild the
> > channels only if the flag is set.
> >
> > Signed-off-by: Peter Xu <address@hidden>
> > ---
> > migration/migration.c | 52
> > ++++++++++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 41 insertions(+), 11 deletions(-)
> >
> > diff --git a/migration/migration.c b/migration/migration.c
> > index 36ff8c3..64de0ee 100644
> > --- a/migration/migration.c
> > +++ b/migration/migration.c
> > @@ -1244,6 +1244,15 @@ void qmp_migrate(const char *uri, bool has_blk, bool
> > blk,
> > MigrationState *s = migrate_get_current();
> > const char *p;
> >
> > + if (has_resume && resume) {
> > + if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
> > + error_setg(errp, "Cannot resume if there is no "
> > + "paused migration");
> > + return;
> > + }
> > + goto do_resume;
> > + }
> > +
> > if (migration_is_setup_or_active(s->state) ||
> > s->state == MIGRATION_STATUS_CANCELLING ||
> > s->state == MIGRATION_STATUS_COLO) {
> > @@ -1279,6 +1288,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool
> > blk,
> >
> > s = migrate_init();
> >
> > +do_resume:
>
> Can we find a way to avoid this label?
> Perhaps split the bottom half of this function out into a separate
> function?
Yes this label can indeed be avoided (sorry for my laziness). Will
take the suggestion. Thanks,
--
Peter Xu