diff options
| author | Juraj Marcin <jmarcin@redhat.com> | 2024-09-04 12:37:12 +0200 |
|---|---|---|
| committer | David Hildenbrand <david@redhat.com> | 2024-09-24 11:33:34 +0200 |
| commit | 1b063fe2df002052cc2d10799764979b8c583480 (patch) | |
| tree | 26b813cfbd486aa53344711d7c6deac950ffba56 /include/sysemu/reset.h | |
| parent | 8d018fe59a0beff580ac6b3399d642c4277d9dd0 (diff) | |
| download | focaccia-qemu-1b063fe2df002052cc2d10799764979b8c583480.tar.gz focaccia-qemu-1b063fe2df002052cc2d10799764979b8c583480.zip | |
reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()
Currently, both qemu_devices_reset() and MachineClass::reset() use ShutdownCause for the reason of the reset. However, the Resettable interface uses ResetState, so ShutdownCause needs to be translated to ResetType somewhere. Translating it qemu_devices_reset() makes adding new reset types harder, as they cannot always be matched to a single ShutdownCause here, and devices may need to check the ResetType to determine what to reset and if to reset at all. This patch moves this translation up in the call stack to qemu_system_reset() and updates all MachineClass children to use the ResetType instead. Message-ID: <20240904103722.946194-2-jmarcin@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Juraj Marcin <jmarcin@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'include/sysemu/reset.h')
| -rw-r--r-- | include/sysemu/reset.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/sysemu/reset.h b/include/sysemu/reset.h index ae436044a9..0e297c0e02 100644 --- a/include/sysemu/reset.h +++ b/include/sysemu/reset.h @@ -27,6 +27,7 @@ #ifndef QEMU_SYSEMU_RESET_H #define QEMU_SYSEMU_RESET_H +#include "hw/resettable.h" #include "qapi/qapi-events-run-state.h" typedef void QEMUResetHandler(void *opaque); @@ -110,7 +111,7 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque); /** * qemu_devices_reset: Perform a complete system reset - * @reason: reason for the reset + * @reason: type of the reset * * This function performs the low-level work needed to do a complete reset * of the system (calling all the callbacks registered with @@ -121,6 +122,6 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque); * If you want to trigger a system reset from, for instance, a device * model, don't use this function. Use qemu_system_reset_request(). */ -void qemu_devices_reset(ShutdownCause reason); +void qemu_devices_reset(ResetType type); #endif |