qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-riscv@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	"Daniel P. Berrange" <berrange@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: Re: Purpose of QOM properties registered at realize time?
Date: Wed, 7 Oct 2020 14:04:23 +0200	[thread overview]
Message-ID: <a6e652d9-548f-4d4e-e451-48e3f5e11031@redhat.com> (raw)
In-Reply-To: <20201006220647.GR7303@habkost.net>

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.

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



  parent reply	other threads:[~2020-10-07 12:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 22:06 Purpose of QOM properties registered at realize time? Eduardo Habkost
2020-10-07 10:35 ` BALATON Zoltan via
2020-10-07 12:04 ` Paolo Bonzini [this message]
2020-10-07 13:02   ` Eduardo Habkost
2020-10-07 13:55     ` Paolo Bonzini
2020-10-07 14:27       ` Eduardo Habkost
2020-10-07 14:54         ` Paolo Bonzini
2020-10-07 15:51           ` Eduardo Habkost
2020-10-07 15:58             ` Peter Maydell
2020-10-07 14:28 ` Peter Maydell
2020-10-07 15:48   ` Eduardo Habkost
2020-10-08  9:45   ` Markus Armbruster
2020-10-08 10:00     ` Peter Maydell
2020-10-08 15:15     ` Eduardo Habkost
2020-10-08 15:41       ` Peter Maydell
2020-10-12 10:30 ` Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6e652d9-548f-4d4e-e451-48e3f5e11031@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).