]> git.proxmox.com Git - mirror_qemu.git/commit
reset: Add RESET_TYPE_SNAPSHOT_LOAD
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 12 Apr 2024 16:08:09 +0000 (17:08 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 25 Apr 2024 09:21:59 +0000 (10:21 +0100)
commit631f46d4ea7cb7ac0e529aacc1e7d832473f96c3
tree9fb50b1412c0c4a12ec3d371b30d65c3556630b5
parent41d49ec190db9171d2ebb158fd4d5daad06ed8e1
reset: Add RESET_TYPE_SNAPSHOT_LOAD

Some devices and machines need to handle the reset before a vmsave
snapshot is loaded differently -- the main user is the handling of
RNG seed information, which does not want to put a new RNG seed into
a ROM blob when we are doing a snapshot load.

Currently this kind of reset handling is supported only for:
 * TYPE_MACHINE reset methods, which take a ShutdownCause argument
 * reset functions registered with qemu_register_reset_nosnapshotload

To allow a three-phase-reset device to also distinguish "snapshot
load" reset from the normal kind, add a new ResetType
RESET_TYPE_SNAPSHOT_LOAD. All our existing reset methods ignore
the reset type, so we don't need to update any device code.

Add the enum type, and make qemu_devices_reset() use the
right reset type for the ShutdownCause it is passed. This
allows us to get rid of the device_reset_reason global we
were using to implement qemu_register_reset_nosnapshotload().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Luc Michel <luc.michel@amd.com>
Message-id: 20240412160809.1260625-7-peter.maydell@linaro.org
docs/devel/reset.rst
hw/core/reset.c
hw/core/resettable.c
include/hw/resettable.h