[PATCH 00/16] qom qapi: QOM introspection interface cleanup

Markus Armbruster via Devel posted 16 patches 1 day, 15 hours ago
Failed in applying to current master (apply log)
docs/about/deprecated.rst                     |  5 ++
qapi/qom.json                                 | 74 +++++++++++++++----
include/qom/object.h                          | 15 +---
hw/ppc/spapr_drc.c                            |  4 +-
qom/object.c                                  | 56 +++++++-------
qom/qom-hmp-cmds.c                            |  2 +-
qom/qom-qmp-cmds.c                            | 18 +++++
tests/qtest/device-introspect-test.c          |  4 +-
tests/qtest/qom-test.c                        |  8 +-
tests/qtest/readconfig-test.c                 |  5 +-
.../qemu-config-qmp-cmds.c                    |  9 ++-
monitor/meson.build                           |  1 -
python/qemu/utils/qom.py                      |  2 +-
python/qemu/utils/qom_common.py               | 28 ++++---
util/meson.build                              |  3 +-
15 files changed, 151 insertions(+), 83 deletions(-)
rename monitor/qemu-config-qmp.c => util/qemu-config-qmp-cmds.c (96%)
[PATCH 00/16] qom qapi: QOM introspection interface cleanup
Posted by Markus Armbruster via Devel 1 day, 15 hours ago
QOM introspection provides a "type" value that qom/object.h calls
"pretty loosely defined".  This lack of discipline has turned out to
be problematic.  There's a zoo of "well-known" values consumers need
to know, and these are documented by handwaving or not at all.  The
values for child and link properties need to be parsed, which is an
anti-pattern for QMP.

Marc-André's "qom/qdev: associate properties with QAPI schema types"
provided a much better alternative: a "qapi-type" that can be looked
up in output of query-qmp-schema.

Except we still need to parse "type" to recognize and make sense of
QOM link and child properties.  My series closes this gap.

Three parts:

* PATCH 01-08 replace most uses of ObjectProperty member @type.  After
  PATCH 08, only printing help in type_print_class_properties() and
  copying to result "type" of QMP commands qom-list,
  qom-list-properties, qom-list-get remain.

* PATCH 09-15 eliminates in-tree uses of this result.

* PATCH 16 deprecates this result.

This is for 12.0, obviously.

Based-on: <20261117103629.2612744-1-armbru@redhat.com>
Based-on: <20261117105945.2802923-1-armbru@redhat.com>
Based-on: <20261118182005.1066151-1-armbru@redhat.com>

Markus Armbruster (16):
  util: Move QMP command query-command-line-options back to util/
  util: Wean query-command-line-options off ObjectProperty member @type
  monitor: Fix query-command-line-options for -machine integer
    parameters
  qom: New ObjectProperty member @qom_type
  qom: Inline object_property_get_type() into its only caller
  qom: Simplify object_resolve_link()
  qom: Wean "is child?" checks off ObjectProperty member @type
  qom: Wean "is link?" checks off ObjectProperty member @type
  qom: Extend ObjectPropertyInfo so clients don't have to parse @type
  qom: Wean HMP commands off ObjectPropertyInfo member @type
  tests: Wean off ObjectPropertyInfo member @type
  python/qemu: Wean off ObjectPropertyInfo member @type
  qom: Extend ObjectPropertyValue so clients don't have to parse @type
  tests: Wean off ObjectPropertyValue member @type
  python/qemu: Wean off ObjectPropertyValue member @type
  qom: Deprecate ObjectPropertyInfo, ObjectPropertyValue member @type

 docs/about/deprecated.rst                     |  5 ++
 qapi/qom.json                                 | 74 +++++++++++++++----
 include/qom/object.h                          | 15 +---
 hw/ppc/spapr_drc.c                            |  4 +-
 qom/object.c                                  | 56 +++++++-------
 qom/qom-hmp-cmds.c                            |  2 +-
 qom/qom-qmp-cmds.c                            | 18 +++++
 tests/qtest/device-introspect-test.c          |  4 +-
 tests/qtest/qom-test.c                        |  8 +-
 tests/qtest/readconfig-test.c                 |  5 +-
 .../qemu-config-qmp-cmds.c                    |  9 ++-
 monitor/meson.build                           |  1 -
 python/qemu/utils/qom.py                      |  2 +-
 python/qemu/utils/qom_common.py               | 28 ++++---
 util/meson.build                              |  3 +-
 15 files changed, 151 insertions(+), 83 deletions(-)
 rename monitor/qemu-config-qmp.c => util/qemu-config-qmp-cmds.c (96%)

-- 
2.55.0