qemu-riscv
[Top][All Lists]
Advanced

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

Re: Purpose of QOM properties registered at realize time?


From: Eduardo Habkost
Subject: Re: Purpose of QOM properties registered at realize time?
Date: Wed, 7 Oct 2020 09:02:40 -0400

On Wed, Oct 07, 2020 at 02:04:23PM +0200, Paolo Bonzini wrote:
> On 07/10/20 00:06, Eduardo Habkost wrote:
> > Hi,
> > 
> > While trying to understand how QOM properties are used in QEMU, I
> > stumbled upon multiple cases where alias properties are added at
> > realize time.
> > 
> > Now, I don't understand why those properties exist.  As the
> > properties are added at realize time, I assume they aren't
> > supposed to be touched by the user at all.  If they are not
> > supposed to be touched by the user, what exactly is the purpose
> > of those QOM properties?
> 
> In the case of GPIOs, I think they will be used by other devices that
> are added afterwards.

Do you know how exactly are they used?  Is this always wrapped
behind a specific API for GPIOs, or the devices can look for the
properties directly?

I'm concerned by the possibility of having QOM properties as an
undocumented part of an internal API.


> 
> The remaining ones are:
> 
> > hw/arm/allwinner-h3.c=232=static void allwinner_h3_realize(DeviceState 
> > *dev, Error **errp)
> > hw/arm/allwinner-h3.c:359:    object_property_add_alias(OBJECT(s), 
> > "sd-bus", OBJECT(&s->mmc0),
> > --
> > hw/arm/bcm2835_peripherals.c=128=static void 
> > bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
> > hw/arm/bcm2835_peripherals.c:322:    object_property_add_alias(OBJECT(s), 
> > "sd-bus", OBJECT(&s->gpio), "sd-bus");
> > --
> > hw/arm/bcm2836.c=69=static void bcm2836_realize(DeviceState *dev, Error 
> > **errp)
> > hw/arm/bcm2836.c:87:    object_property_add_alias(OBJECT(s), "sd-bus", 
> > OBJECT(&s->peripherals),
> > --
> > hw/arm/xlnx-zynqmp.c=276=static void xlnx_zynqmp_realize(DeviceState *dev, 
> > Error **errp)
> > hw/arm/xlnx-zynqmp.c:522:        object_property_add_alias(OBJECT(s), 
> > bus_name, sdhci, "sd-bus");
> 
> And this are probably usable with "bus=sd-bus" or something like that on
> other devices, too.
> 
> Paolo
> 

-- 
Eduardo




reply via email to

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