All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Zhao Liu" <zhao1.liu@intel.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Thomas Huth" <thuth@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Zide Chen" <zide.chen@intel.com>,
	"Dapeng Mi" <dapeng1.mi@linux.intel.com>,
	qemu-devel@nongnu.org, devel@lists.libvirt.org,
	"Kevin Wolf" <kwolf@redhat.com>
Subject: Re: [PATCH v2 00/21] qom: introduce property flags to track external user input
Date: Mon, 16 Mar 2026 16:43:54 +0100	[thread overview]
Message-ID: <87tsufpyo5.fsf@pond.sub.org> (raw)
In-Reply-To: <abFqwbCCf7rNDEWs@redhat.com> ("Daniel P. Berrangé"'s message of "Wed, 11 Mar 2026 13:14:41 +0000")

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Wed, Mar 11, 2026 at 02:05:24PM +0100, Markus Armbruster wrote:
>> I can't find a good spot in the existing discussion where the following
>> would fit neatly as a reply, so I'm starting at the top again.
>> 
>> Fact: a huge part of our external interface is *accidental* and
>> virtually undocumented.
>> 
>> The sane way to do an external interface is to layer it on top of more
>> powerful internal interfaces.  The external interface exposes just the
>> functionality that's wanted there.  The internal interfaces can evolve
>> without affecting the external one.
>> 
>> QMP works that way.  QEMU code uses internal C interfaces.  QEMU doesn't
>> send QMP commands to itself.  If we need something internally, we add it
>> to a suitable internal interface.  There's no need to add it to the
>> external interface just for that.
>> 
>> QOM does not work that way.  The internal and the external object
>> configuration interface is one and the same.  So, if we add a property
>> for internal use, we can't *not* add it to the external interface.
>> 
>> This has led to an external interface that is frickin' huge: I count
>> ~1000 device types with ~16000 properties in qemu-system-aarch64 alone.
>> The vast majority is undocumented.
>> 
>> Time and again we've found ourselves unsure whether certain properties
>> have external uses, or are even meant for external use.
>> 
>> We have been unable / unwilling to isolate the external interface from
>> internal detail.  This is madness.
>> 
>> As long as we persist in this madness, a sane, properly documented
>> external interface will remain impossible.
>> 
>> Do we care?  If yes, we should discuss how to isolate external and
>> internal interfaces.
>> 
>> This series attempts to create a bit of infrastructure for such
>> isolation: means to mark properties as internal.  Is it the right
>> infrastructure?  Is it enough to be a useful step?  Maybe not, but then
>> I'd like to hear better ideas.
>
> For -object / object_add  we introduced formal QAPI modelling of
> all Object subclasses which implement the UserCreatable interface.
> IIUC, that gives us the desired separation between internal and
> external views, as only properties declared in qapi/qom.json are
> publically settable.

Correct.  Kevin Wolf's work.

> This work did not apply to the Device classes because the historical
> baggage with qdev being grafted onto qom, means we don't have that
> working via the UserCreatable inteface or -object/object_add.
>
> Can we bring Device into the same world though ?

Kevin Wolf took a stab at it.  I had a hard time understanding it back
then.  Various pennies finally dropped when he patiently explained it to
me in person.  I disliked certain aspects of its design, and wanted to
explore a bit more.  Never found the time.  Perhaps we should just take
it despite my design misgivings.

> Adding 1000 device types to QAPI is a huge job, so it would need to
> be a long incremental job, unless perhaps we auto-generate QAPI
> descriptions for everything that already exists ?

Interesting idea.

QAPI is declarative: types and their properties are declared in a
schema.

QOM is imperative: we execute C code to create types and their
properties.

Extracting a QAPI schema from the C code is impossible in the completely
general case (halting problem), and merely impractical (I believe) in
the special cases we have.

We could start with QOM introspection instead: qom-list-types and
qom-list-properties.  These are only mostly complete, but should be good
enough.

Mapping QOM types to QAPI types would involve guesswork, because QOM
doesn't have a type system, it has strings and bailing wire.

Schema documentation would be placeholders at best.  We could try to
extract documentation from -device T,help.  Most properties have nothing
there, and the remainder likely needs to be rewritten completely to be
fit for purpose.

> More generally anything we can do to bring qdev & qom closer together
> feels desirable. I dream of a future where -device/device_add are
> obsolete....

That would be lovely.



  parent reply	other threads:[~2026-03-16 15:44 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  3:23 [PATCH v2 00/21] qom: introduce property flags to track external user input Zhao Liu
2026-02-10  3:23 ` [PATCH v2 01/21] qom/object: use BIT macro for ObjectPropertyFlags Zhao Liu
2026-03-20  9:53   ` Thomas Huth
2026-02-10  3:23 ` [PATCH v2 02/21] qom/object: cache ObjectPropertyFlags in ObjectProperty Zhao Liu
2026-03-20  9:53   ` Thomas Huth
2026-02-10  3:23 ` [PATCH v2 03/21] qom/object: factor out object_class_property_try_add() Zhao Liu
2026-02-10 14:41   ` BALATON Zoltan
2026-02-11  7:14     ` Zhao Liu
2026-02-10  3:23 ` [PATCH v2 04/21] qom/object: add flags argument in object_{class_}property_try_add() Zhao Liu
2026-02-10  3:23 ` [PATCH v2 05/21] qom/object: rename object_{class_}property_try_add() to object_{class_}property_add_full() Zhao Liu
2026-02-10  3:23 ` [PATCH v2 06/21] qom/object: add helpers to set/get/clear property flags Zhao Liu
2026-02-10  3:23 ` [PATCH v2 07/21] qom/object: introduce user interaction flags for properties Zhao Liu
2026-02-10  9:49   ` Daniel P. Berrangé
2026-02-10  9:58     ` Daniel P. Berrangé
2026-02-11  8:19       ` Zhao Liu
2026-02-10 14:44   ` BALATON Zoltan
2026-02-11  7:22     ` Zhao Liu
2026-02-10  3:23 ` [PATCH v2 08/21] qom/object: add from_user argument in object_property_parse() Zhao Liu
2026-02-10  3:23 ` [PATCH v2 09/21] qom/object: mark global property set from CLI as USER_SET Zhao Liu
2026-02-10  3:23 ` [PATCH v2 10/21] qom/qom-hmp-cmd: mark properties set from HMP (non-JSON) "qom-set" " Zhao Liu
2026-02-10  3:23 ` [PATCH v2 11/21] qom/qom-qmp-cmd: mark properties set from QMP/HMP (JSON) " Zhao Liu
2026-02-10  3:23 ` [PATCH v2 12/21] qom/object_interfaces: mark properties set from qdict & keyval " Zhao Liu
2026-02-10  3:23 ` [PATCH v2 13/21] system/vl: mark property set in object_parse_property_opt() " Zhao Liu
2026-02-10  3:23 ` [PATCH v2 14/21] hw/core/qdev-properties: allow qdev properties accept flags Zhao Liu
2026-02-10  9:41   ` Peter Krempa
2026-02-11  7:10     ` Zhao Liu
2026-02-10  9:56   ` Daniel P. Berrangé
2026-02-11  7:30     ` Zhao Liu
2026-02-11 16:58       ` Daniel P. Berrangé
2026-02-12 15:25         ` Zhao Liu
2026-02-12 15:42           ` Daniel P. Berrangé
2026-03-09 13:34             ` Zhao Liu
2026-02-18  9:51         ` Igor Mammedov
2026-03-06  9:14           ` Markus Armbruster
2026-03-06  9:19             ` Daniel P. Berrangé
2026-03-06  9:30         ` Markus Armbruster
2026-03-09 13:52           ` Zhao Liu
2026-02-10  3:23 ` [PATCH v2 15/21] target/i386: deprecate fill-mtrr-mask property Zhao Liu
2026-02-10  3:23 ` [PATCH v2 16/21] target/i386: deprecate cpuid-0xb property Zhao Liu
2026-02-10  3:23 ` [PATCH v2 17/21] hw/intc/ioapic: deprecate version property Zhao Liu
2026-02-10  3:23 ` [PATCH v2 18/21] target/i386: mark x-consistent-cache property as internal-only Zhao Liu
2026-02-10  3:23 ` [PATCH v2 19/21] target/i386: remove redundant validation for lbr-fmt property Zhao Liu
2026-03-13 22:34   ` Chen, Zide
2026-02-10  3:23 ` [PATCH v2 20/21] target/i386: detect user provided lbr-fmt via property flag Zhao Liu
2026-03-13 22:36   ` Chen, Zide
2026-02-10  3:23 ` [PATCH v2 21/21] hw/core/qdev-properties: support valid default value for DEFINE_PROP_UINT64_CHECKMASK Zhao Liu
2026-03-13 22:36   ` Chen, Zide
2026-02-10 10:12 ` [PATCH v2 00/21] qom: introduce property flags to track external user input Daniel P. Berrangé
2026-02-10 10:44   ` Michael S. Tsirkin
2026-02-10 11:00     ` Daniel P. Berrangé
2026-02-10 15:00       ` BALATON Zoltan
2026-02-10 15:28   ` Zhao Liu
2026-02-10 15:16     ` BALATON Zoltan
2026-02-11  7:24       ` Zhao Liu
2026-02-11 11:28         ` BALATON Zoltan
2026-02-12 15:31           ` Zhao Liu
2026-02-12 15:56             ` BALATON Zoltan
2026-02-10 15:41     ` Daniel P. Berrangé
2026-02-11  7:06       ` Zhao Liu
2026-02-11 11:18         ` Daniel P. Berrangé
2026-03-11 13:05 ` Markus Armbruster
2026-03-11 13:14   ` Daniel P. Berrangé
2026-03-11 13:38     ` Peter Krempa
2026-03-16 15:43     ` Markus Armbruster [this message]
2026-03-16 16:05       ` BALATON Zoltan
2026-03-16 18:00         ` Markus Armbruster
2026-03-20 10:09       ` Daniel P. Berrangé
2026-03-23 15:37       ` Kevin Wolf

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=87tsufpyo5.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=devel@lists.libvirt.org \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=zhao1.liu@intel.com \
    --cc=zide.chen@intel.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.