From: Peter Xu Date: Wed, 4 Oct 2023 22:02:39 +0000 (-0400) Subject: migration: Allow RECOVER->PAUSED convertion for dest qemu X-Git-Tag: qemu-xen-4.20.0~496^2~58 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0e99bb8f54418231baa084f1d8270e7500e48245;p=qemu-xen.git migration: Allow RECOVER->PAUSED convertion for dest qemu There's a bug on dest that if a double fault triggered on dest qemu (a network issue during postcopy-recover), we won't set PAUSED correctly because we assumed we always came from ACTIVE. Fix that by always overwriting the state to PAUSE. We could also check for these two states, but maybe it's an overkill. We did the same on the src QEMU to unconditionally switch to PAUSE anyway. Reviewed-by: Fabiano Rosas Reviewed-by: Juan Quintela Signed-off-by: Peter Xu Signed-off-by: Juan Quintela Message-ID: <20231004220240.167175-10-peterx@redhat.com> --- diff --git a/migration/savevm.c b/migration/savevm.c index 60eec7c31f..497ce02bd7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2734,7 +2734,8 @@ static bool postcopy_pause_incoming(MigrationIncomingState *mis) qemu_mutex_unlock(&mis->postcopy_prio_thread_mutex); } - migrate_set_state(&mis->state, MIGRATION_STATUS_POSTCOPY_ACTIVE, + /* Current state can be either ACTIVE or RECOVER */ + migrate_set_state(&mis->state, mis->state, MIGRATION_STATUS_POSTCOPY_PAUSED); /* Notify the fault thread for the invalidated file handle */