qemu-e2k/include/migration
Steve Sistare 58b105703e migration: preserve suspended for snapshot
Restoring a snapshot can break a suspended guest.  Snapshots suffer from
the same suspended-state issues that affect live migration, plus they must
handle an additional problematic scenario, which is that a running vm must
remain running if it loads a suspended snapshot.

To save, the existing vm_stop call now completely stops the suspended
state.  Finish with vm_resume to leave the vm in the state it had prior
to the save, correctly restoring the suspended state.

To load, if the snapshot is not suspended, then vm_stop + vm_resume
correctly handles all states, and leaves the vm in the state it had prior
to the load.  However, if the snapshot is suspended, restoration is
trickier.  First, call vm_resume to restore the state to suspended so the
current state matches the saved state.  Then, if the pre-load state is
running, call wakeup to resume running.

Prior to these changes, the vm_stop to RUN_STATE_SAVE_VM and
RUN_STATE_RESTORE_VM did not change runstate if the current state was
suspended, but now it does, so allow these transitions.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/1704312341-66640-8-git-send-email-steven.sistare@oracle.com
Signed-off-by: Peter Xu <peterx@redhat.com>
2024-01-04 09:52:42 +08:00
..
blocker.h migration: per-mode blockers 2023-11-01 16:13:59 +01:00
colo.h migration: process_incoming_migration_co(): move colo part to colo 2023-05-18 18:40:51 +02:00
cpu.h Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
failover.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
global_state.h migration: never fail in global_state_store() 2023-06-02 01:03:19 +02:00
misc.h migration: mode parameter 2023-11-01 16:13:58 +01:00
qemu-file-types.h migration: Move rate_limit_max and rate_limit_used to migration_stats 2023-05-18 18:40:51 +02:00
register.h migration: hold the BQL during setup 2023-10-17 09:25:13 +02:00
snapshot.h migration: preserve suspended for snapshot 2024-01-04 09:52:42 +08:00
vmstate.h migration: Hack to maintain backwards compatibility for ppc 2023-11-01 16:13:58 +01:00