From 0acd12d817622ca0a3cf9475d3a179267aa6c320 Mon Sep 17 00:00:00 2001 From: liuhaolin Date: Thu, 16 Apr 2026 20:45:55 +0800 Subject: [PATCH] do not reset migration state on device reset (#844) Unconditionally resetting migration state to RUNNING on device reset caused desynchronization with migration initiators(e.g. QEMU) when a reset occurred during the pre-copy phase, leading to invalid state transitions and aborted migrations. The reset operation should only discard captured device state, not modify the active migration state machine. Signed-off-by: liuhaolin --- lib/libvfio-user.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 03b26084..21a4545f 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -888,16 +888,12 @@ static int device_reset(vfu_ctx_t *vfu_ctx, vfu_reset_type_t reason) { int ret; - + ret = call_reset_cb(vfu_ctx, reason); if (ret < 0) { return ret; } - if (vfu_ctx->migration != NULL) { - migr_state_transition(vfu_ctx->migration, - VFIO_USER_DEVICE_STATE_RUNNING); - } return 0; }