On 19.06.2026 12:55, Andrey Drobyshev wrote:
Devices register their own callbacks to MIG_EVENT_* notifications and
process them accordingly.  But some devices, especially during CPR-style
migration, might need to be aware and process SETUP event earlier on.  One
such example is vhost-based devs, as they need to call RESET_OWNER ioctl
before the target (in the cpr-transfer case) tries to call SET_OWNER.

Let's move SETUP notification to an earlier place in qmp_migrate().  Before
this change, SETUP was firing shortly before migration thread creation, and
FAILED notification balancing it was only fired from
migration_iteration_finish() (ran in the thread).  But now by moving SETUP
to earlier we widen the window.  Hence let's also add FAILED to
migration_connect_error_propagate() and the special CPR-related case in
migration_cancel(), to balance things out.

This patch is a rework of the change originally proposed by Steve and
Ben at [0].

[0] 
https://lore.kernel.org/qemu-devel/[email protected]

Originally-by: Steve Sistare <[email protected]>
Originally-by: Ben Chaney <[email protected]>
Signed-off-by: Andrey Drobyshev <[email protected]>
---
Looks okay to me, but will wait on Peter and/or Fabiano opinion here,
since this is core migration code.

Thanks,
Maciej


Reply via email to