All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/31] qapi/qom: QAPIfy --object and object-add
@ 2021-02-24 13:52 Kevin Wolf
  2021-02-24 13:52 ` [PATCH v2 01/31] tests: Drop 'props' from object-add calls Kevin Wolf
                   ` (31 more replies)
  0 siblings, 32 replies; 82+ messages in thread
From: Kevin Wolf @ 2021-02-24 13:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, lvivier, thuth, pkrempa, berrange, ehabkost, qemu-block,
	libvir-list, jasowang, armbru, mreitz, kraxel, pbonzini,
	dgilbert

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-v2


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 (31):
  tests: Drop 'props' from object-add calls
  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-img: Use user_creatable_process_cmdline() for --object
  qemu-nbd: Use user_creatable_process_cmdline() for --object
  qom: Add user_creatable_add_from_str()
  hmp: QAPIfy object_add
  qom: Add user_creatable_parse_str()
  vl: QAPIfy -object
  qom: Drop QemuOpts based interfaces

 qapi/authz.json                      |  62 +++
 qapi/block-core.json                 |  27 ++
 qapi/common.json                     |  52 +++
 qapi/crypto.json                     | 159 +++++++
 qapi/machine.json                    |  22 +-
 qapi/net.json                        |  20 -
 qapi/qom.json                        | 639 ++++++++++++++++++++++++++-
 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                           | 239 ++--------
 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 |  25 +-
 tests/check-qom-proplist.c           |  42 +-
 tests/qtest/qmp-cmd-test.c           |  16 +-
 tests/qtest/test-netfilter.c         |  54 +--
 hmp-commands.hx                      |   2 +-
 storage-daemon/qapi/qapi-schema.json |   1 +
 tests/qemu-iotests/087               |   8 +-
 tests/qemu-iotests/184               |  18 +-
 tests/qemu-iotests/218               |   2 +-
 tests/qemu-iotests/235               |   2 +-
 tests/qemu-iotests/245               |   4 +-
 tests/qemu-iotests/258               |   6 +-
 tests/qemu-iotests/258.out           |   4 +-
 tests/qemu-iotests/295               |   2 +-
 tests/qemu-iotests/296               |   2 +-
 35 files changed, 1270 insertions(+), 694 deletions(-)

-- 
2.29.2



^ permalink raw reply	[flat|nested] 82+ messages in thread

end of thread, other threads:[~2021-03-02 20:05 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 13:52 [PATCH v2 00/31] qapi/qom: QAPIfy --object and object-add Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 01/31] tests: Drop 'props' from object-add calls Kevin Wolf
2021-02-25 22:40   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 02/31] qapi/qom: Drop deprecated 'props' from object-add Kevin Wolf
2021-02-25 22:42   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 03/31] qapi/qom: Add ObjectOptions for iothread Kevin Wolf
2021-02-25 22:55   ` Eric Blake
2021-03-02 17:27     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 04/31] qapi/qom: Add ObjectOptions for authz-* Kevin Wolf
2021-02-26 14:02   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 05/31] qapi/qom: Add ObjectOptions for cryptodev-* Kevin Wolf
2021-02-26 14:36   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 06/31] qapi/qom: Add ObjectOptions for dbus-vmstate Kevin Wolf
2021-02-26 15:58   ` Eric Blake
2021-03-02 17:36     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 07/31] qapi/qom: Add ObjectOptions for memory-backend-* Kevin Wolf
2021-02-26 16:23   ` Eric Blake
2021-03-02 18:11     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened' Kevin Wolf
2021-02-26 16:54   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 09/31] qapi/qom: Add ObjectOptions for throttle-group Kevin Wolf
2021-02-26 17:26   ` Eric Blake
2021-03-02 18:18     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 10/31] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded' Kevin Wolf
2021-02-26 19:17   ` Eric Blake
2021-03-02 18:23     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 11/31] qapi/qom: Add ObjectOptions for tls-*, " Kevin Wolf
2021-02-26 19:33   ` Eric Blake
2021-03-02 18:27     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 12/31] qapi/qom: Add ObjectOptions for can-* Kevin Wolf
2021-02-26 19:42   ` Eric Blake
2021-03-02 18:32     ` Kevin Wolf
2021-03-02 20:03       ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 13/31] qapi/qom: Add ObjectOptions for colo-compare Kevin Wolf
2021-02-26 19:46   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 14/31] qapi/qom: Add ObjectOptions for filter-* Kevin Wolf
2021-02-26 20:03   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 15/31] qapi/qom: Add ObjectOptions for pr-manager-helper Kevin Wolf
2021-02-26 20:04   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 16/31] qapi/qom: Add ObjectOptions for confidential-guest-support Kevin Wolf
2021-02-24 15:21   ` Dr. David Alan Gilbert
2021-02-24 16:25     ` Kevin Wolf
2021-02-26 20:27   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 17/31] qapi/qom: Add ObjectOptions for input-* Kevin Wolf
2021-02-26 20:55   ` Eric Blake
2021-03-02 18:42     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 18/31] qapi/qom: Add ObjectOptions for x-remote-object Kevin Wolf
2021-02-26 21:01   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 19/31] qapi/qom: QAPIfy object-add Kevin Wolf
2021-02-26 11:30   ` Paolo Bonzini
2021-03-01 11:54     ` Kevin Wolf
2021-03-01 12:03       ` Paolo Bonzini
2021-02-26 21:18   ` Eric Blake
2021-03-02 18:54     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 20/31] qom: Make "object" QemuOptsList optional Kevin Wolf
2021-02-26 21:20   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 21/31] qemu-storage-daemon: Implement --object with qmp_object_add() Kevin Wolf
2021-02-26 21:22   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 22/31] qom: Remove user_creatable_add_dict() Kevin Wolf
2021-02-26 21:23   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 23/31] qom: Factor out user_creatable_process_cmdline() Kevin Wolf
2021-02-26 21:26   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 24/31] qemu-io: Use user_creatable_process_cmdline() for --object Kevin Wolf
2021-02-26 21:27   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 25/31] qemu-img: " Kevin Wolf
2021-02-26 21:56   ` Eric Blake
2021-02-26 22:17     ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 26/31] qemu-nbd: " Kevin Wolf
2021-02-26 22:18   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 27/31] qom: Add user_creatable_add_from_str() Kevin Wolf
2021-02-26 22:21   ` Eric Blake
2021-03-02 19:39     ` Kevin Wolf
2021-02-24 13:52 ` [PATCH v2 28/31] hmp: QAPIfy object_add Kevin Wolf
2021-02-24 15:31   ` Dr. David Alan Gilbert
2021-02-26 22:23   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 29/31] qom: Add user_creatable_parse_str() Kevin Wolf
2021-02-26 22:24   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 30/31] vl: QAPIfy -object Kevin Wolf
2021-02-26 22:40   ` Eric Blake
2021-02-24 13:52 ` [PATCH v2 31/31] qom: Drop QemuOpts based interfaces Kevin Wolf
2021-02-26 22:42   ` Eric Blake
2021-02-24 16:01 ` [PATCH v2 00/31] qapi/qom: QAPIfy --object and object-add Peter Krempa

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.