From: Marc-André Lureau <[email protected]> QOM introspection is flawed: the type information is just a string (ObjectPropertyInfo and ObjectPropertyValue field 'type'). Management applications need to know these strings. Their documentation is of little help.
QAPI introspection is more powerful, and management applications already know how to use it. Let's put it to use for QOM introspection. Add an optional 'qapi-type' field to ObjectPropertyInfo and ObjectPropertyValue. When present, it contains the masked type name that can be looked up in query-qmp-schema output. Absent for properties without a QAPI type association. Always absent for now, populated in the following changes. This cannot fully replace 'type', yet: it doesn't cover child and link properties. Mark 'unstable' for now. Reviewed-by: Markus Armbruster <[email protected]> Signed-off-by: Marc-André Lureau <[email protected]> Signed-off-by: Markus Armbruster <[email protected]> --- qapi/qom.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qapi/qom.json b/qapi/qom.json index 4810d53e58..df523c08c7 100644 --- a/qapi/qom.json +++ b/qapi/qom.json @@ -35,15 +35,24 @@ # qdev device type name. Link properties form the device model # graph. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @description: if specified, the description of the property. # # @default-value: the default value, if any (since 5.0) # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 1.2 ## { 'struct': 'ObjectPropertyInfo', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*description': 'str', '*default-value': 'any' } } @@ -55,14 +64,23 @@ # @type: the type of the property, as described in # `ObjectPropertyInfo`. # +# @qapi-type: the name of the property's type as it appears in the +# output of ``query-qmp-schema``. Absent if the type does not +# occur there. (since 11.2) +# # @value: the value of the property. Absent when the property cannot # be read. # +# Features: +# +# @unstable: Member @qapi-type is experimental. +# # Since: 10.1 ## { 'struct': 'ObjectPropertyValue', 'data': { 'name': 'str', 'type': 'str', + '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] }, '*value': 'any' } } ## -- 2.55.0
