> > Do you think this function could be turned into a libqtest call?
> 
> Seems like a good idea.
> 
> > It would take mach_a as an argument, add -incoming
> > tcp:localhost:4444
> > to the command line of mach_a, use that to spawn mach_b, and
> 
> why add to mach_a? I thought -incoming is just for the destination.

Yep.  Tack it at the end of mach_a's command line (actually at the end
of the parameter of qtest_start) and use the result to start mach_b.  The
command-lines for the two machines must match (apart from -incoming of
course), it's not necessary to pass it twice.

> > return mach_b as the return value (or perhaps change mach_a to
> > refer to the new machine).
> 
> I think it makes sense for the caller to create and pass the machines
> and then just call a library function to do the migrate. That way the
> caller 'owns' the machines. But maybe I'm missing something.

Yeah, owning the machines makes sense.  In this case migration would
just be a constructor for QTestState.

The alternative is to kill mach_a during migration and only proceed
with mach_b, since mach_a is effectively not going to be used.

Paolo

Reply via email to