mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
8d018fe59a
commit
1b063fe2df
13 changed files with 37 additions and 29 deletions
|
@ -170,11 +170,8 @@ void qemu_unregister_resettable(Object *obj)
|
|||
resettable_container_remove(get_root_reset_container(), obj);
|
||||
}
|
||||
|
||||
void qemu_devices_reset(ShutdownCause reason)
|
||||
void qemu_devices_reset(ResetType type)
|
||||
{
|
||||
ResetType type = (reason == SHUTDOWN_CAUSE_SNAPSHOT_LOAD) ?
|
||||
RESET_TYPE_SNAPSHOT_LOAD : RESET_TYPE_COLD;
|
||||
|
||||
/* Reset the simulation */
|
||||
resettable_reset(OBJECT(get_root_reset_container()), type);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue