freenode
Databases & Infrastructure

QEMU ties QOM properties to QAPI types for management tools

A large series from Marc-André Lureau adds formal schema cross-references so clients no longer guess from free-form type strings.

QEMU is moving to bind object and device properties to the QAPI type system, so management tools can learn each property's real schema type instead of parsing informal strings.

Today those properties advertise free-form labels such as "bool", "uint32", or "OnOffAuto". Those strings have no guaranteed link to the schema returned by query-qmp-schema, forcing libvirt and similar clients into ad-hoc mappings and naming conventions. Marc-André Lureau's latest revision of the work, co-signed throughout with Markus Armbruster, introduces generated type metadata, a new qapi-type field on the QMP property-info structs, and conversion of the old property definitions onto that pointer. The free-form type and enum-table fields, plus a handful of legacy add-enum helpers, are on the way out.

Along the way the series replaces several hand-rolled visitors and string tables (virtio-balloon guest stats, RTC struct-tm dates, PCA955x LED and pin states) with proper QAPI types, and it tightens array properties so element type lives with the property info rather than duplicated call-site macros. Armbruster's survey of qom-list output shows many former near-misses and plain wrong labels (lists reported as bare "list", enums mislabeled as bool or str) becoming accurate schema names.

Whether the old type string can be deprecated quickly is still open. Libvirt still inspects it in at least one path (CPU properties checking for "bool"); Ján Tomko indicated that check can move to the JSON type instead. Daniel Berrangé also flagged the pci device-function property, whose metadata is shifting from "str" toward "int32" even though setters still accept the familiar dotted string form widely used on the command line and in QMP. Lureau called that a metadata-only change that need not block the series, while agreeing a cleaner alternate type would be better later.

If the design lands, external tools gain a stable cross-walk from live object properties into query-qmp-schema without maintaining private type tables.