aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-10-25 02:43:17 +0200
committerPeter Maydell <peter.maydell@linaro.org>2022-10-27 11:34:31 +0100
commit7966d70f6f6b188475e67c2c363f19eec3d28c96 (patch)
treebbd0a95d1d8b8c64bb8dbaf37d38e8f85af5ada6 /softmmu
parentc8d6c286ab4bff1c5ff511f3e834fb2a713d65d2 (diff)
downloadqemu-7966d70f6f6b188475e67c2c363f19eec3d28c96.zip
qemu-7966d70f6f6b188475e67c2c363f19eec3d28c96.tar.gz
qemu-7966d70f6f6b188475e67c2c363f19eec3d28c96.tar.bz2
reset: allow registering handlers that aren't called by snapshot loading
Snapshot loading only expects to call deterministic handlers, not non-deterministic ones. So introduce a way of registering handlers that won't be called when reseting for snapshots. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Message-id: 20221025004327.568476-2-Jason@zx2c4.com [PMM: updated json doc comment with Markus' text; fixed checkpatch style nit] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/runstate.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 1e68680..3dd83d5 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -441,11 +441,16 @@ void qemu_system_reset(ShutdownCause reason)
cpu_synchronize_all_states();
if (mc && mc->reset) {
- mc->reset(current_machine);
+ mc->reset(current_machine, reason);
} else {
- qemu_devices_reset();
+ qemu_devices_reset(reason);
}
- if (reason && reason != SHUTDOWN_CAUSE_SUBSYSTEM_RESET) {
+ switch (reason) {
+ case SHUTDOWN_CAUSE_NONE:
+ case SHUTDOWN_CAUSE_SUBSYSTEM_RESET:
+ case SHUTDOWN_CAUSE_SNAPSHOT_LOAD:
+ break;
+ default:
qapi_event_send_reset(shutdown_caused_by_guest(reason), reason);
}
cpu_synchronize_all_post_reset();