qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'Device


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/3] hw/acpi/cpu_hotplug: Convert 'Object *device' -> 'DeviceState *parent'
Date: Tue, 28 Feb 2023 23:13:06 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 28/2/23 23:09, Michael S. Tsirkin wrote:
On Tue, Feb 28, 2023 at 11:05:24PM +0100, Philippe Mathieu-Daudé wrote:
On 28/2/23 22:41, Michael S. Tsirkin wrote:
On Fri, Feb 03, 2023 at 05:30:21PM +0100, Philippe Mathieu-Daudé wrote:
ACPI CPU hotplug parent can't be any QOM object, it must be a QDev.
Convert AcpiCpuHotplug::device field as QDev to enforce this.
Rename 'owner' and 'device' variables as 'parent'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


So instead of plain gpe->device we now have OBJECT all over
the place. Why is this an improvement?

 From QOM PoV, in this prototype change:

   void legacy_acpi_cpu_hotplug_init(MemoryRegion *container,
- Object *owner,
+ DeviceState *parent,

we promote the parent/owner argument from generic Object to
Device, which is more restrictive.

Thus now you can not pass any QOM object, it has to be a QDev.

None of the functions really seem to care what kind of object
they get. Anything that results in less casting is a win
in my book. More casting - a loss.

OK we are discussing QOM design then. I'll go back to this
in a future RFC. Sorry for having wasted your time meanwhile.



reply via email to

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