qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 6/6] reset: Add RESET_TYPE_SNAPSHOT_LOAD


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 6/6] reset: Add RESET_TYPE_SNAPSHOT_LOAD
Date: Fri, 12 Apr 2024 19:31:35 +0200
User-agent: Mozilla Thunderbird

On 12/4/24 18:08, Peter Maydell wrote:
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>
---
  docs/devel/reset.rst    | 17 ++++++++++++++---
  include/hw/resettable.h |  1 +
  hw/core/reset.c         | 15 ++++-----------
  hw/core/resettable.c    |  4 ----
  4 files changed, 19 insertions(+), 18 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]