All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH qemu] qom: Document qom/device-list-properties implementation specific
Date: Thu, 3 May 2018 16:22:41 +1000	[thread overview]
Message-ID: <20c40fb6-b2d1-1b9c-46bf-dce93bfccc56@ozlabs.ru> (raw)
In-Reply-To: <c1d40d88-1c80-2bbd-c28c-613b7fe8d45e@redhat.com>

On 2/5/18 7:50 pm, Paolo Bonzini wrote:
> On 02/05/2018 11:33, Alexey Kardashevskiy wrote:
>>>>>>> +# Note: the handler creates an object, enumerates properties and destroys
>>>>>>> +# the object so it only lists properties created in TypeInfo::instance_init().
>>>>>>> +# Since the instance_init() callback of the device object adds
>>>>>>> +# DeviceClass::props as object properties, they will be listed as well.
>>
>> There are roughly 400 of realize(), this is will take a bit of time :)
>> imho what it does belongs to .json, why it does exactly that belongs to the
>> git commit log. I'll walk through the realize() hook though, educate
>> myself, at least :)
> 
> Cheer up, there are only 300 callers of object_property_add_* (apart
> from object_property_add_child which is generally not an issue).  You
> could look at those instead. :)

I did not have to go too far for an example:

piix4_pm_realize() calls piix4_pm_add_propeties() and acpi_pcihp_init() and
piix4_acpi_system_hot_add_init() and these guys create
bool/uint8_ptr/uint16_ptr/uint32_ptr properties:



hw/acpi/piix4.c|477| object_property_add_uint8_ptr(OBJECT(s),
ACPI_PM_PROP_ACPI_ENABLE_CMD,
hw/acpi/piix4.c|479| object_property_add_uint8_ptr(OBJECT(s),
ACPI_PM_PROP_ACPI_DISABLE_CMD,
hw/acpi/piix4.c|481| object_property_add_uint32_ptr(OBJECT(s),
ACPI_PM_PROP_GPE0_BLK,
hw/acpi/piix4.c|483| object_property_add_uint32_ptr(OBJECT(s),
ACPI_PM_PROP_GPE0_BLK_LEN,
hw/acpi/piix4.c|485| object_property_add_uint16_ptr(OBJECT(s),
ACPI_PM_PROP_SCI_INT,
hw/acpi/piix4.c|487| object_property_add_uint32_ptr(OBJECT(s),
ACPI_PM_PROP_PM_IO_BASE,
hw/acpi/piix4.c|642| object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy",



> Seriously, I think the problem with the comment is only that the reader
> most likely doesn't care about instance_init() or props, as those are
> QEMU implementation details.
So I am putting the chunk below (cut-n-pasted from this thread) for each
command (i.e. twice) instead of my stuff and repost?

===
  Objects can create properties at runtime, for example to describe
  links between different devices and/or objects. These properties
  are not included in the output of this command.
===




--
Alexey

  reply	other threads:[~2018-05-03  6:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-03  0:25 [Qemu-devel] [PATCH qemu v4 0/2] qmp: Add qom-list-properties to list QOM object properties Alexey Kardashevskiy
2018-03-03  0:25 ` [Qemu-devel] [PATCH qemu v4 1/2] qmp: Merge ObjectPropertyInfo and DevicePropertyInfo Alexey Kardashevskiy
2018-04-18 16:35   ` Eric Blake
2018-04-30 10:04     ` Paolo Bonzini
2018-03-03  0:25 ` [Qemu-devel] [PATCH qemu v4 2/2] qmp: Add qom-list-properties to list QOM object properties Alexey Kardashevskiy
2018-04-13 14:16   ` Markus Armbruster
2018-04-30  6:52     ` [Qemu-devel] [PATCH qemu] qom: Document qom/device-list-properties implementation specific Alexey Kardashevskiy
2018-04-30  6:56       ` no-reply
2018-04-30  7:07         ` Alexey Kardashevskiy
2018-04-30  6:58       ` no-reply
2018-04-30  7:00       ` no-reply
2018-04-30  9:39       ` Paolo Bonzini
2018-05-02  1:26         ` Alexey Kardashevskiy
2018-05-02  6:34           ` Markus Armbruster
2018-05-02  9:11             ` Paolo Bonzini
2018-05-02  9:33               ` Alexey Kardashevskiy
2018-05-02  9:50                 ` Paolo Bonzini
2018-05-03  6:22                   ` Alexey Kardashevskiy [this message]
2018-05-03 10:54                     ` Paolo Bonzini
2018-05-02  9:38               ` Markus Armbruster
2018-05-02  9:47                 ` Paolo Bonzini
2018-05-02 12:36                   ` Markus Armbruster
2018-05-02 12:42                     ` Paolo Bonzini
2018-05-02 13:31                       ` Markus Armbruster
2018-05-02 13:32                         ` Paolo Bonzini
2018-05-01 13:01       ` Eric Blake
2018-05-02  1:33         ` Alexey Kardashevskiy

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=20c40fb6-b2d1-1b9c-46bf-dce93bfccc56@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.