]> git.ipfire.org Git - thirdparty/qemu.git/commit
reset: Use ResetType for qemu_devices_reset() and MachineClass::reset()
authorJuraj Marcin <jmarcin@redhat.com>
Wed, 4 Sep 2024 10:37:12 +0000 (12:37 +0200)
committerDavid Hildenbrand <david@redhat.com>
Tue, 24 Sep 2024 09:33:34 +0000 (11:33 +0200)
commit1b063fe2df002052cc2d10799764979b8c583480
tree26b813cfbd486aa53344711d7c6deac950ffba56
parent8d018fe59a0beff580ac6b3399d642c4277d9dd0
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>
13 files changed:
hw/arm/aspeed.c
hw/arm/mps2-tz.c
hw/core/reset.c
hw/hppa/machine.c
hw/i386/microvm.c
hw/i386/pc.c
hw/ppc/pegasos2.c
hw/ppc/pnv.c
hw/ppc/spapr.c
hw/s390x/s390-virtio-ccw.c
include/hw/boards.h
include/sysemu/reset.h
system/runstate.c