Skip to content

qapi/qom: QAPIfy --object and object-add

Kevin Wolf qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest30 patches 47 repliesIn review
  2. v231 patches 50 repliesSuperseded
  3. v118 patches 41 repliesSuperseded

Changes in v3 from the cover letter

- Removed now useless QAuthZListRuleListHack
- Made some more ObjectOptions branches conditional
- Improved documentation for some properties
- Fixed 'qemu-img compare' exit code for option parsing failure

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30qapi/qom: Drop deprecated 'props' from object-adddocs/system/deprecated.rst docs/system/removed-features.rst qapi/qom.json +1 more+6 -310 replies
2/30qapi/qom: Add ObjectOptions for iothreadqapi/qom.json+53 -00 replies
3/30qapi/qom: Add ObjectOptions for authz-*qapi/authz.json qapi/qom.json storage-daemon/qapi/qapi-schema.json+67 -51 reply
4/30qapi/qom: Add ObjectOptions for cryptodev-*qapi/qom.json+35 -01 reply
5/30qapi/qom: Add ObjectOptions for dbus-vmstateqapi/qom.json+18 -00 replies
6/30qapi/qom: Add ObjectOptions for memory-backend-*qapi/common.json qapi/machine.json qapi/qom.json+141 -221 reply
7/30qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened'docs/system/deprecated.rst qapi/qom.json+63 -20 replies
8/30qapi/qom: Add ObjectOptions for throttle-groupqapi/block-core.json qapi/qom.json+32 -20 replies
9/30qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded'docs/system/deprecated.rst qapi/crypto.json qapi/qom.json+77 -01 reply
10/30qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded'qapi/crypto.json qapi/qom.json+108 -21 reply
11/30qapi/qom: Add ObjectOptions for can-*qapi/qom.json+18 -00 replies
12/30qapi/qom: Add ObjectOptions for colo-compareqapi/qom.json+49 -00 replies
13/30qapi/qom: Add ObjectOptions for filter-*qapi/common.json qapi/net.json qapi/qom.json+163 -200 replies
14/30qapi/qom: Add ObjectOptions for pr-manager-helperqapi/qom.json+14 -00 replies
15/30qapi/qom: Add ObjectOptions for confidential-guest-supportqapi/qom.json+37 -00 replies
16/30qapi/qom: Add ObjectOptions for input-*qapi/common.json qapi/qom.json qapi/ui.json+72 -120 replies
17/30qapi/qom: Add ObjectOptions for x-remote-objectqapi/qom.json+18 -20 replies
18/30qapi/qom: QAPIfy object-addhw/block/xen-block.c include/qom/object_interfaces.h monitor/misc.c +3 more+32 -310 replies
19/30qom: Make "object" QemuOptsList optionalqom/object_interfaces.c+5 -20 replies
20/30qemu-storage-daemon: Implement --object with qmp_object_add()storage-daemon/qemu-storage-daemon.c+10 -110 replies
21/30qom: Remove user_creatable_add_dict()include/qom/object_interfaces.h qom/object_interfaces.c+0 -500 replies
22/30qom: Factor out user_creatable_process_cmdline()include/qom/object_interfaces.h qom/object_interfaces.c qom/qom-qmp-cmds.c +1 more+80 -553 replies
23/30qemu-io: Use user_creatable_process_cmdline() for --objectqemu-io.c+3 -300 replies
24/30qemu-nbd: Use user_creatable_process_cmdline() for --objectqemu-nbd.c+3 -310 replies
25/30qom: Add user_creatable_add_from_str()include/qom/object_interfaces.h qom/object_interfaces.c+40 -50 replies
26/30qemu-img: Use user_creatable_process_cmdline() for --objectqemu-img.c+45 -2067 replies
27/30hmp: QAPIfy object_addhmp-commands.hx monitor/hmp-cmds.c qom/object_interfaces.c+9 -216 replies
28/30qom: Add user_creatable_parse_str()include/qom/object_interfaces.h qom/object_interfaces.c+29 -60 replies
29/30vl: QAPIfy -objectsoftmmu/vl.c+84 -251 reply
30/30qom: Drop QemuOpts based interfacesinclude/qom/object_interfaces.h qom/object_interfaces.c tests/check-qom-proplist.c+20 -1620 replies

Reviews trailers per patch

All 30 patches have a Reviewed-by or Acked-by.

PatchPeter KrempaEric BlakeDr. David Alan GilbertDaniel P. Berrangé
1/30A-b R-b
2/30A-b R-b
3/30A-b R-b A-b
4/30A-b R-b
5/30A-b R-b
6/30A-b R-b
7/30A-b R-b
8/30A-b R-b
9/30A-b R-b A-b
10/30A-b R-b A-b
11/30A-b R-b
12/30A-b R-b
13/30A-b R-b
14/30A-b R-b
15/30A-b R-b
16/30A-b R-b
17/30A-b R-b
18/30A-b R-b
19/30A-b R-b
20/30A-b R-b
21/30A-b R-b
22/30A-b R-b
23/30A-b R-b
24/30A-b R-b
25/30A-b R-b
26/30A-b R-b
27/30A-b R-b R-b
28/30A-b R-b
29/30A-b R-b
30/30A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

This series adds a QAPI type for the properties of all user creatable QOM types and finally makes the --object command line option (in all binaries) and the object-add monitor commands (in QMP and HMP) use the new ObjectOptions union.

This change improves things in more than just one way:

1. Documentation for QOM object types has always been lacking. Adding the schema, we get documentation for every property.

2. It prevents bugs by performing parts of the input validation (e.g. checking presence of mandatory properties) already in QAPI instead of relying on separate manual implementations in each class.

3. It provides QAPI introspection for user creatable objects.

4. Non-scalar properties are now supported everywhere because the command line parsers (including HMP) use the keyval parser now.

If you are in the CC list and didn't expect this series, it's probably because you're the maintainer of one of the objects for which I'm adding a QAPI schema description. Please just have a look at the specific patch for your object and check whether the schema and its documentation make sense to you. You can ignore all other patches.

In a next step after this series, we can add make use of the QAPI structs in the implementation of the object and separate their configuration from the runtime state. Specifically, the plan is to add a .configure() callback to ObjectClass that allows configuring the object in one place at creation time and keeping QOM property setters only for properties that can actually be changed at runtime. Paolo made an example of what the state could look like after this:

https://wiki.qemu.org/Features/QOM-QAPI_integration

Finally, the intention is to extend the QAPI schema to have separate 'object' entities and generate some of the code that was written manually in the intermediate state before.

This series is available as a git tag at:

https://repo.or.cz/qemu/kevin.git qapi-object-v3

v3:
- Removed now useless QAuthZListRuleListHack
- Made some more ObjectOptions branches conditional
- Improved documentation for some properties
- Fixed 'qemu-img compare' exit code for option parsing failure

v2:
- Convert not only object-add, but all external interfaces so that the schema will always be enforced and mismatch between implementation and schema can't go unnoticed.
- Rebased, covering properties and object types added since v1 (yes, things do become outdated rather quickly when you touch all user creatable objects)
- Changed the "Since:" version number in the schema documentation to refer to the version when the object was introduced rather than 6.0 where the schema will (hopefully) be added
- Probably some other minor changes

Kevin Wolf (30):
qapi/qom: Drop deprecated 'props' from object-add qapi/qom: Add ObjectOptions for iothread
qapi/qom: Add ObjectOptions for authz-*
qapi/qom: Add ObjectOptions for cryptodev-* qapi/qom: Add ObjectOptions for dbus-vmstate qapi/qom: Add ObjectOptions for memory-backend-* qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened' qapi/qom: Add ObjectOptions for throttle-group qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded' qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded' qapi/qom: Add ObjectOptions for can-*
qapi/qom: Add ObjectOptions for colo-compare qapi/qom: Add ObjectOptions for filter-*
qapi/qom: Add ObjectOptions for pr-manager-helper qapi/qom: Add ObjectOptions for confidential-guest-support qapi/qom: Add ObjectOptions for input-*
qapi/qom: Add ObjectOptions for x-remote-object qapi/qom: QAPIfy object-add
qom: Make "object" QemuOptsList optional
qemu-storage-daemon: Implement --object with qmp_object_add()
qom: Remove user_creatable_add_dict()
qom: Factor out user_creatable_process_cmdline()
qemu-io: Use user_creatable_process_cmdline() for --object
qemu-nbd: Use user_creatable_process_cmdline() for --object
qom: Add user_creatable_add_from_str()
qemu-img: Use user_creatable_process_cmdline() for --object
hmp: QAPIfy object_add
qom: Add user_creatable_parse_str()
vl: QAPIfy -object
qom: Drop QemuOpts based interfaces

 qapi/authz.json                      |  61 ++-
 qapi/block-core.json                 |  27 ++
 qapi/common.json                     |  52 +++
 qapi/crypto.json                     | 159 +++++++
 qapi/machine.json                    |  22 +-
 qapi/net.json                        |  20 -
 qapi/qom.json                        | 644 ++++++++++++++++++++++++++-
 qapi/ui.json                         |  13 +-
 docs/system/deprecated.rst           |  25 +-
 docs/system/removed-features.rst     |   5 +
 include/qom/object_interfaces.h      | 106 ++---
 hw/block/xen-block.c                 |  16 +-
 monitor/hmp-cmds.c                   |  17 +-
 monitor/misc.c                       |   2 -
 qemu-img.c                           | 251 ++---------
 qemu-io.c                            |  33 +-
 qemu-nbd.c                           |  34 +-
 qom/object_interfaces.c              | 168 +++----
 qom/qom-qmp-cmds.c                   |  28 +-
 softmmu/vl.c                         | 109 +++--
 storage-daemon/qemu-storage-daemon.c |  27 +-
 tests/check-qom-proplist.c           |  42 +-
 hmp-commands.hx                      |   2 +-
 storage-daemon/qapi/qapi-schema.json |   1 +
 24 files changed, 1231 insertions(+), 633 deletions(-)
Signature · 1 line
2.29.2