Skip to contentSkip to conversation

qom: Document qom/device-list-properties implementation specific

PATCH Superseded Alexey Kardashevskiy 3 participants 3 messages May 14, 2018 – May 15, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qom: Document qom/device-list-properties implementation specific

The recently introduced qom-list-properties QMP command raised a question what properties it (and its cousin - device-list-properties) can possibly print - only those defined by DeviceClass::props or dynamically created in TypeInfo::instance_init() so properties created elsewhere won't show up and this behaviour might confuse the user. For example, PIIX4 does that from piix4_pm_realize():

hw/acpi/piix4.c|477| object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,

This adds a note to the command descriptions about the limitation.

---
Changes:
v2:
* changed wording

---
 qapi/misc.json | 8 ++++++++
 1 file changed, 8 insertions(+)
qapi/misc.json +8 -0
index f5988cc..efc3d23 100644
@@ -1529,6 +1529,10 @@
 #
 # Returns: a list of ObjectPropertyInfo describing a devices properties
 #
+# Note: 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.
+#
 # Since: 1.2
 ##
 { 'command': 'device-list-properties',
@@ -1542,6 +1546,10 @@
 #
 # @typename: the type name of an object
 #
+# Note: 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.
+#
 # Returns: a list of ObjectPropertyInfo describing object properties
 #
 # Since: 2.12
Signature · 1 line
2.11.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Alexey Kardashevskiy

The recently introduced qom-list-properties QMP command raised a question what properties it (and its cousin - device-list-properties) can possibly print - only those defined by DeviceClass::props or dynamically created in TypeInfo::instance_init() so properties created elsewhere won't show up and this behaviour might confuse the user. For example, PIIX4 does that from piix4_pm_realize():

hw/acpi/piix4.c|477| object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,

I'd like to tweak this to

For example, PIIX4 does that from piix4_pm_realize() via piix4_pm_add_propeties():

      object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,
                                    &acpi_enable_cmd, NULL);

if you don't mind.

Quoted 3 lines

This adds a note to the command descriptions about the limitation.

Thanks!

Acked-by
#2 lore raw
Quoted 22 lines · Markus Armbruster
Quoted 9 lines · Alexey Kardashevskiy

The recently introduced qom-list-properties QMP command raised a question what properties it (and its cousin - device-list-properties) can possibly print - only those defined by DeviceClass::props or dynamically created in TypeInfo::instance_init() so properties created elsewhere won't show up and this behaviour might confuse the user. For example, PIIX4 does that from piix4_pm_realize():

hw/acpi/piix4.c|477| object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,

I'd like to tweak this to

For example, PIIX4 does that from piix4_pm_realize() via piix4_pm_add_propeties():

      object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,
                                    &acpi_enable_cmd, NULL);

if you don't mind.

Quoted 8 lines
Quoted 3 lines

This adds a note to the command descriptions about the limitation.

Thanks!

Thanks,

Paolo