On Tue, Aug 01, 2017 at 11:59:07AM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > This patch detects the "resume" flag of migration command, rebuild the > > channels only if the flag is set. > > > > Signed-off-by: Peter Xu <pet...@redhat.com> > > --- > > 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