On Fri, Feb 02, 2024 at 04:57 PM +1000, Nicholas Piggin <npig...@gmail.com> 
wrote:
> Starting a pipeline of jobs in the background does not seem to have
> a simple way to reliably find the pid of a particular process in the
> pipeline (because not all processes are started when the shell
> continues to execute).
>
> The way PID of QEMU is derived can result in a failure waiting on a
> PID that is not running. This is easier to hit with subsequent
> multiple-migration support. Changing this to use $! by swapping the
> pipeline for a fifo is more robust.
>
> Signed-off-by: Nicholas Piggin <npig...@gmail.com>
> ---

[…snip…]

>  
> +     # Wait until the destination has created the incoming and qmp sockets
> +     while ! [ -S ${migsock} ] ; do sleep 0.1 ; done
> +     while ! [ -S ${qmp2} ] ; do sleep 0.1 ; done

There should be timeout implemented, otherwise we might end in an
endless loop in case of a bug. Or is the global timeout good enough to
handle this situation?

> +
>       qmp ${qmp1} '"migrate", "arguments": { "uri": "unix:'${migsock}'" }' > 
> ${qmpout1}
>  
>       # Wait for the migration to complete
> -- 
> 2.42.0
>
>
-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

Reply via email to