On Tue, Aug 01, 2017 at 12:36:22PM +0100, Dr. David Alan Gilbert wrote:
> * Peter Xu ([email protected]) wrote:
[...]
> > @@ -2043,9 +2054,32 @@ static bool postcopy_pause(MigrationState *s)
> > qemu_sem_wait(&s->postcopy_pause_sem);
> > }
> >
> > - trace_postcopy_pause_continued();
> > + if (s->state == MIGRATION_STATUS_POSTCOPY_RECOVER) {
> > + /* We were waken up by a recover procedure. Give it a shot */
> >
> > - return true;
> > + /*
> > + * Firstly, let's wake up the return path now, with a new
> > + * return path channel.
> > + */
> > + qemu_sem_post(&s->postcopy_pause_rp_sem);
> > +
> > + /* Do the resume logic */
> > + if (postcopy_do_resume(s) == 0) {
> > + /* Let's continue! */
> > + trace_postcopy_pause_continued();
> > + return true;
> > + } else {
> > + /*
> > + * Something wrong happened during the recovery, let's
> > + * pause again. Pause is always better than throwing data
> > + * away.
> > + */
> > + goto do_pause;
>
> You should be able to turn this around into a do {} while or similar
> rather than goto.
Indeed. Fixing up. Thanks,
--
Peter Xu