qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/5] migration: Allow network to fail even during recovery


From: Peter Xu
Subject: Re: [PATCH v4 2/5] migration: Allow network to fail even during recovery
Date: Tue, 31 Oct 2023 11:32:56 -0400

On Tue, Oct 31, 2023 at 03:26:42PM +0100, Juan Quintela wrote:
> > -void migration_rp_wait(MigrationState *s)
> > +int migration_rp_wait(MigrationState *s)
> >  {
> > +    /* If migration has failure already, ignore the wait */
> > +    if (migrate_has_error(s)) {
> > +        return -1;
> > +    }
> > +
> >      qemu_sem_wait(&s->rp_state.rp_sem);
> > +
> > +    /* After wait, double check that there's no failure */
> > +    if (migrate_has_error(s)) {
> > +        return -1;
> > +    }
> > +
> > +    return 0;
> >  }
> 
> Shouldn't this be bool?
> 
> We have (too many) functions in migration that returns 0/-1 and set an
> error, I think we should change them to return bool.  Or even just test
> if err is set.

Yeah this patch comes earlier than "switching to bools".  I can make them
bool after I rebase to the new pulls and see what's leftover.  Thanks.

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]