On 06.08.24 18:07, Juraj Marcin wrote:
Some devices need to distinguish cold start reset from waking up from a
suspended state. This patch adds new value to the enum, and updates the
i386 wakeup method to use this new reset type.

Signed-off-by: Juraj Marcin <jmar...@redhat.com>
---
  docs/devel/reset.rst    | 7 +++++++
  hw/i386/pc.c            | 2 +-
  include/hw/resettable.h | 2 ++
  3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/devel/reset.rst b/docs/devel/reset.rst
index 9746a4e8a0..30c9a0cc2b 100644
--- a/docs/devel/reset.rst
+++ b/docs/devel/reset.rst
@@ -44,6 +44,13 @@ The Resettable interface handles reset types with an enum 
``ResetType``:
    value on each cold reset, such as RNG seed information, and which they
    must not reinitialize on a snapshot-load reset.
+``RESET_TYPE_WAKEUP``
+  This type is used when the machine is woken up from a suspended state (deep
+  sleep, suspend-to-ram). Devices that must not be reset to their initial state
+  after wake-up (for example virtio-mem) can use this state to differentiate
+  cold start from wake-up can use this state to differentiate cold start from
+  wake-up.
+
  Devices which implement reset methods must treat any unknown ``ResetType``
  as equivalent to ``RESET_TYPE_COLD``; this will reduce the amount of
  existing code we need to change if we add more types in future.

^ That sounds like using this for x86 below should just work.

Reviewed-by: David Hildenbrand <da...@redhat.com>

--
Cheers,

David / dhildenb


Reply via email to