On Fri, Oct 02, 2026 at 01:02:58PM +0200, Denis V. Lunev wrote: > From: Denis V. Lunev <[email protected]> > > Commit 7b842fe354c ("migration: Introduce POSTCOPY_DEVICE state") keeps > the source in POSTCOPY_DEVICE until the destination answers the > QEMU_VM_PING_PACKAGED_LOADED ping packaged right before > CMD_POSTCOPY_RUN. The destination answers it from the generic > MIG_CMD_PING handler as soon as it reads it, so the source's > postcopy-active means the device state is loaded, not that the > destination has left RUN_STATE_INMIGRATE. Management acting on the > destination once the source reports postcopy-active can still race > with loadvm_postcopy_handle_run_bh(). > > Record the ping in the MIG_CMD_PING handler instead of answering it, > and send the pong at the end of the run BH, after the run state change. > > The wire format is unchanged: the pong only arrives later, and an > older destination keeps answering at once, so mixed versions > interoperate. The cost is that the source stays in POSTCOPY_DEVICE for > the duration of the run BH, including block layer activation when the > destination autostarts. > > Suggested-by: Peter Xu <[email protected]> > Signed-off-by: Denis V. Lunev <[email protected]> > Cc: Peter Xu <[email protected]> > Cc: Fabiano Rosas <[email protected]> > Cc: Juraj Marcin <[email protected]>
The hope is this should work for Juraj's problem too, https://lore.kernel.org/all/[email protected]/ If there is a repost, maybe worth mention it in commit log, but we can also wait for more inputs. This looks reasonable to me on its own, Reviewed-by: Peter Xu <[email protected]> -- Peter Xu
