qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and Machin


From: Peter Maydell
Subject: Re: [PATCH 1/4] reset: Use ResetType for qemu_devices_reset() and MachineClass->reset()
Date: Thu, 8 Aug 2024 13:32:37 +0100

On Tue, 6 Aug 2024 at 17:08, Juraj Marcin <jmarcin@redhat.com> wrote:
>
> 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.

I have a work-in-progress refactoring which makes
TYPE_MACHINE be a subclass of TYPE_DEVICE, with the aim of
converting all the MachineClass::reset functions into
proper Resettable reset functions. If we did that then all
these reset functions would take a ResetType anyway.
But I might not get round to having another go at that
refactoring for a while, and this is a good cleanup in the
meantime.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

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