[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V5 05/12] migration: preserve suspended runstate
|
From: |
Fabiano Rosas |
|
Subject: |
Re: [PATCH V5 05/12] migration: preserve suspended runstate |
|
Date: |
Mon, 20 Nov 2023 14:30:26 -0300 |
Steve Sistare <steven.sistare@oracle.com> writes:
> A guest that is migrated in the suspended state automaticaly wakes and
> continues execution. This is wrong; the guest should end migration in
> the same state it started. The root cause is that the outgoing migration
> code automatically wakes the guest, then saves the RUNNING runstate in
> global_state_store(), hence the incoming migration code thinks the guest is
> running and continues the guest if autostart is true.
>
> Simply deleting the call to qemu_system_wakeup_request() on the outgoing
> side, to migrate the vm in state suspended, does not solve the problem.
> The old vm_stop_force_state does little if the vm is suspended, so the cpu
> clock remains running, and runstate notifiers for the stop transition are
> not called (and were not called on transition to suspended). Stale cpu
> timers_state is saved to the migration stream, causing time errors in the
> guest when it wakes from suspend. State that would have been modified by
> runstate notifiers is wrong.
>
> The new version of vm_stop_force_state solves the outgoing problems, by
> completely stopping a vm in the suspended state.
>
> On the incoming side for precopy, compute the desired new state from global
> state received, and call runstate_restore, which will partially
> resume the vm if the state is suspended. A future system_wakeup monitor
> request will cause the vm to resume running.
>
> On the incoming side for postcopy, apply the the same restore logic found
> in precopy.
>
> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
- [PATCH V5 00/12] fix migration of suspended runstate, Steve Sistare, 2023/11/13
- [PATCH V5 02/12] cpus: stop vm in suspended state, Steve Sistare, 2023/11/13
- [PATCH V5 01/12] cpus: refactor vm_stop, Steve Sistare, 2023/11/13
- [PATCH V5 03/12] cpus: pass runstate to vm_prepare_start, Steve Sistare, 2023/11/13
- [PATCH V5 05/12] migration: preserve suspended runstate, Steve Sistare, 2023/11/13
- Re: [PATCH V5 05/12] migration: preserve suspended runstate,
Fabiano Rosas <=
- [PATCH V5 09/12] tests/qtest: option to suspend during migration, Steve Sistare, 2023/11/13
- [PATCH V5 06/12] migration: preserve suspended for snapshot, Steve Sistare, 2023/11/13
- [PATCH V5 11/12] tests/qtest: postcopy migration with suspend, Steve Sistare, 2023/11/13
- [PATCH V5 04/12] cpus: start vm in suspended state, Steve Sistare, 2023/11/13
- [PATCH V5 07/12] migration: preserve suspended for bg_migration, Steve Sistare, 2023/11/13
- [PATCH V5 12/12] tests/qtest: background migration with suspend, Steve Sistare, 2023/11/13