From: Markus Armbruster via qemu development <qemu-devel@nongnu.org>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH 00/54] qom/qdev: associate properties with QAPI schema types
Date: Wed, 29 Jul 2026 09:28:23 +0200 [thread overview]
Message-ID: <878q6us19k.fsf@pond.sub.org> (raw)
In-Reply-To: <20260510-qom-qapi-v1-0-48ba6a1a1fa5@redhat.com> ("Marc-André Lureau"'s message of "Sun, 10 May 2026 17:42:57 +0400")
I started writing this reply right when I saw the series, i.e. an
embarrassingly long time ago. Then stuff happened, some of it good,
some bad, this review got crowded out, and my memory purged.
I sincerely apologize for the massive delay.
Naturally, this needs a rebase now. But let me try to review it as is.
Marc-André Lureau <marcandre.lureau@redhat.com> writes:
> Hi,
>
> This series connects QOM and qdev properties to the QAPI type system, so
> that management tools can discover the QAPI schema type of each object
> property.
Sounds lovely!
> Today, QOM properties carry a free-form "type" string ("bool", "uint32",
> "OnOffAuto", ..) that has no formal link to the QAPI schema exposed by
> query-qmp-schema. Management tools must maintain ad-hoc mappings or rely
> on naming conventions to figure out how to interpret property values.
Correct.
Before I dive into individual patches, let me try to work out what the
series does as a whole.
> This series adds:
> - A new QAPITypeInfo struct that pairs a property with its QAPI schema
> type name, enum lookup table, and list-element type.
Peeking at the code, I see that ObjectProperty gains a member @qapi_type
pointing to its QAPITypeInfo.
It is null when the ObjectProperty doesn't have a QAPI type.
If it's non-null, then ObjectProperty members @name and @type are
redundant with qapi_type.name and .type.
Correct?
Would "every ObjectProperty has a QAPI type" be a reasonable goal for
the future?
>
> - A QAPI code generator (qapi-type-infos) that emits a QAPITypeInfo
> instance for every schema-defined type, including the mapping
> between internal C names and the schema name visible to clients.
Peeking at the code, I find:
* The type
typedef struct QAPITypeInfo {
const char *name;
const char *schema_name;
const QEnumLookup *lookup;
const struct QAPITypeInfo *list;
} QAPITypeInfo;
* A T_type_info for each QAPI type T, including built-in types.
* T_type_info member @name is T's QAPI name, i.e. "T".
* T_type_info member @schema_name is T's masked name used in
query-qmp-schema output, null when T is elided there.
* T_type_info member @list points to TList_type_info when that exists,
else it's null.
* T_type_info member @lookup points to T_lookup when T is an enum, else
it's null.
Correct?
> - A "qapi-type" field in the ObjectPropertyInfo and
> ObjectPropertyValue QMP structs, populated from the QAPITypeInfo
> when present giving clients a cross-reference into query-qmp-schema
> output.
To be precise: when ObjectPropertyInfo member @type is "T", then member
@qapi-type is T_type_info.qapi-type. Correct?
If .qapi-type is non-null, you can use it to look up precise type
information via QAPI introspection, i.e. query-qmp-schema.
Correct?
Possible problem: query-qmp-schema covers only types that are actually
used in QMP. But the above technique additionally wants QOM property
types. I haven't checked what your series does about this, if anything.
ObjectPropertyInfo is only used with QMP command handlers. It is
computed from ObjectProperty.
> - Conversion of all PropertyInfo definitions from the old
> .type/.enum_table strings to the new .qapi_type pointer.
The above is QOM, this is qdev.
Like ObjectProperty, PropertyInfo gains a member @qapi_type pointing to
its QAPITypeInfo. Howver, this one cannot be null.
PropertyInfo members @type and @enum_table are dropped, because they are
redundant with qapi_type.type and .lookup.
Correct?
> - Replacement of the generic qdev_prop_array with typed per-element
> array PropertyInfos, removing the arrayinfo/arrayfieldsize
> indirection from struct Property.
Before the series, an array-valued Property's @info member is
@qdev_prop_array. @qdev_prop_array provides no information on the array
elements. Instead, Property member @arrayinfo points to the
PropertyInfo for the elements, and @arrayfieldsize is the size of an
element.
Your series makes PropertyInfo array-capable: new members @element_info
and @element_size are the elements' PropertyInfo and size. It then adds
a proper PropertyInfo for each such property, and drops
@qdev_prop_array.
Correct?
This could perhaps be spun out and merged separately to reduce the size
of future respins.
Not mentioned:
- New QOM property creation functions for creating properties of
QAPI type. These take a QAPITypeInfo.
- Convert some properties to use them.
> - Removal of the deprecated PropertyInfo.type and .enum_table fields,
> and of the old object_property_add_enum/add_tm APIs.
>
> Along the way, a few pre-existing type mismatches in property
> definitions are fixed, the "struct tm" RTC property is replaced with a
> proper QAPI StructTm type etc. Introducing more specific types or a
> "typedef" to QAPI could help provide better associated type informations
> than plain "str" in many cases, for example.
Examples?
> Comments welcome!
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
next prev parent reply other threads:[~2026-07-29 7:28 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-10 13:42 [PATCH 00/54] qom/qdev: associate properties with QAPI schema types Marc-André Lureau
2026-05-10 13:42 ` [PATCH 01/54] qapi: add QAPITypeInfo struct definition Marc-André Lureau
2026-05-10 13:42 ` [PATCH 02/54] qapi/introspect: expose the type name map Marc-André Lureau
2026-05-10 13:43 ` [PATCH 03/54] qapi: add type-infos generator Marc-André Lureau
2026-05-10 13:43 ` [PATCH 04/54] qapi/backend: wire up type-infos generation Marc-André Lureau
2026-05-10 13:43 ` [PATCH 05/54] qapi/gen: fix _module_basename for multi-dash 'what' parameters Marc-André Lureau
2026-05-10 13:43 ` [PATCH 06/54] meson: add qapi-type-infos-*.c/h to build Marc-André Lureau
2026-05-10 13:43 ` [PATCH 07/54] qom: add qapi_type field to ObjectProperty Marc-André Lureau
2026-05-10 13:43 ` [PATCH 08/54] qapi/qom: add qapi-type field to ObjectPropertyInfo Marc-André Lureau
2026-05-10 13:43 ` [PATCH 09/54] qom/qmp: populate qapi-type in QMP handlers Marc-André Lureau
2026-05-10 13:43 ` [PATCH 10/54] qom: add QAPI-aware property registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 11/54] tests: update check-qom-proplist for " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 12/54] qom: convert enum properties to QAPI-aware registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 13/54] qom: remove old enum property registration API Marc-André Lureau
2026-05-10 13:43 ` [PATCH 14/54] qom: convert struct properties to QAPI-aware registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 15/54] " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 16/54] x86: convert OnOffAuto " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 17/54] microvm: " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 18/54] pc: convert OnOffAuto vmport property " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 19/54] arm/virt: convert OnOffAuto acpi " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 20/54] riscv/virt: convert OnOffAuto properties " Marc-André Lureau
2026-05-13 2:04 ` Alistair Francis
2026-05-10 13:43 ` [PATCH 21/54] loongarch/virt: " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 22/54] hostmem-file: convert OnOffAuto rom property " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 23/54] sev: convert OnOffAuto legacy-vm-type " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 24/54] whpx: convert OnOffAuto hyperv " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 25/54] whpx: convert OnOffAuto arch properties " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 26/54] accel/kvm: convert OnOffSplit property " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 27/54] whpx: " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 28/54] ppc/spapr-caps: convert to QAPI-aware property registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 29/54] system/memory: fix "priority" property typename Marc-André Lureau
2026-05-10 13:43 ` [PATCH 30/54] hw/mem/nvdimm: fix "size" " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 31/54] qom: convert scalar properties to QAPI-aware registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 32/54] i386/cpu: convert strList property " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 33/54] accel/hvf: convert OnOffSplit " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 34/54] i386/x86: convert SgxEPCList " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 35/54] virtio-balloon: convert guest-stats property to QAPI type Marc-André Lureau
2026-05-10 13:43 ` [PATCH 36/54] qom: replace object_property_add_tm with StructTm " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 37/54] hw/nvdimm: convert UUID property to QAPI-aware registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 38/54] hw/s390-virtio-ccw: convert loadparm " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 39/54] hw/ppc/spapr_drc: convert fdt " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 40/54] spdm-socket: convert SpdmTransportType to QAPI enum Marc-André Lureau
2026-05-10 13:43 ` [PATCH 41/54] hw/pci: change the busnr type to uint8 Marc-André Lureau
2026-05-10 13:43 ` [PATCH 42/54] qdev: add qapi_type field to PropertyInfo with fallback registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 43/54] qdev: convert core PropertyInfo definitions to use qapi_type Marc-André Lureau
2026-05-10 13:43 ` [PATCH 44/54] qdev: convert system " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 45/54] hw: convert device-local " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 46/54] target/riscv: fix incorrect QAPI types and u8 casting Marc-André Lureau
2026-05-13 2:05 ` Alistair Francis
2026-05-10 13:43 ` [PATCH 47/54] target/riscv: convert PropertyInfo definitions to use qapi_type Marc-André Lureau
2026-05-13 2:07 ` Alistair Francis
2026-05-10 13:43 ` [PATCH 48/54] qdev: " Marc-André Lureau
2026-05-10 13:43 ` [PATCH 49/54] qdev: introduce typed array PropertyInfos Marc-André Lureau
2026-05-10 13:43 ` [PATCH 50/54] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo Marc-André Lureau
2026-05-10 13:43 ` [PATCH 51/54] qdev: remove deprecated PropertyInfo.type and .enum_table fields Marc-André Lureau
2026-05-10 13:43 ` [PATCH 52/54] memory: use object_property_add_link for container property Marc-André Lureau
2026-05-10 13:43 ` [PATCH 53/54] qom: drop free-form property typename registration Marc-André Lureau
2026-05-10 13:43 ` [PATCH 54/54] qom: use QAPITypeInfo in object_property_get_enum Marc-André Lureau
2026-07-29 7:28 ` Markus Armbruster via qemu development [this message]
2026-07-29 10:04 ` [PATCH 00/54] qom/qdev: associate properties with QAPI schema types Marc-André Lureau
2026-07-29 12:20 ` Marc-André Lureau
2026-07-29 12:42 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878q6us19k.fsf@pond.sub.org \
--to=qemu-devel@nongnu.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.