From: Peter Xu <peterx@redhat.com>
To: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Cc: qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dave@treblig.org>,
"Cédric Le Goater" <clg@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Alexandr Moshkov" <dtalexundeer@yandex-team.ru>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Thomas Huth" <thuth@redhat.com>, "Kevin Wolf" <kwolf@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Juraj Marcin" <jmarcin@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class
Date: Thu, 11 Dec 2025 10:57:42 -0500 [thread overview]
Message-ID: <aTrp9o3d8pAapahL@x1.local> (raw)
In-Reply-To: <a3b5e158-adae-4c66-89f9-7f0af26c63da@rsg.ci.i.u-tokyo.ac.jp>
On Fri, Dec 12, 2025 at 12:28:21AM +0900, Akihiko Odaki wrote:
> I'm actually less sure if the first half makes sense than the second half.
>
> Exporting Property from QDEV did make me think it may be polluting the
> codebase with QDEV-specifics, but its motivation (creating properties
> without defining accessors) is clear and it meets its requirement.
>
> The motivation is less concrete for the first half. It says the current code
> is explicit, but it is a relative term. I'm not sure if specifying
> TYPE_OBJECT_COMPAT is less explicit (or more implicit) than calling
> object_apply_compat_props(). Also, having a class for compat props but not
> for global props makes the decision look arbitrary. It is nice to have some
> clarification on these.
Thanks for the comments, Akihiko. I can explain.
I explicitly only included object_apply_compat_props() in the current
OBJECT_COMPAT class (rather than set_globals()) is almost two-fold:
- Inclusion of qdev_prop_set_globals() makes the 1st half start to depend
on the 2nd half, that I don't see it strictly necessary. E.g., one
immediate motivation of me looking at this problem is Vladimir's series
on virtio-net/tap [1].
That series should only need patch 1-6 of this series as minimum to
enable machine compat properties for TAP (after QOMify, if that makes
sense on its own).
- qdev_prop_set_globals() itself has a trivial dependency currently
against qdev hotpluggable or not:
object_apply_global_props(OBJECT(dev), global_props(),
dev->hotplugged ? NULL : &error_fatal);
There's way to decouple that I guess, however I just don't see it
necessary yet. The only real user will be migration object, which
doesn't need to depend on this anyway, as long as Property APIs can be
exported.
Do you think we should keep open-code object_apply_compat_props() instead?
In reality, that also works for me at least on figuring out the current
problem [1], and if Property API exported I can also open code it for
migration object. It's just that IMHO it's cleaner we have the light class
to do this (so as to avoid providng post_init() hooks all over the places).
[1] https://lore.kernel.org/all/20251030203116.870742-1-vsementsov@yandex-team.ru/
--
Peter Xu
next prev parent reply other threads:[~2025-12-11 15:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 16:28 [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class Peter Xu
2025-12-09 16:28 ` [PATCH RFC 01/10] qom: Introduce object-compat Peter Xu
2025-12-09 16:28 ` [PATCH RFC 02/10] qdev: Inherit from TYPE_OBJECT_COMPAT Peter Xu
2025-12-09 16:28 ` [PATCH RFC 03/10] hostmem: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 04/10] accel: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 05/10] confidential guest support: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 06/10] qom: Unexport object_apply_compat_props() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 07/10] qdev: Pave way for exporting Property to be used in non-qdev Peter Xu
2025-12-09 16:28 ` [PATCH RFC 08/10] qdev: Introduce helper object_apply_globals() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 09/10] qdev: Refactor and rename of qdev_class_add_property() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 10/10] migration: Inherit from TYPE_OBJECT_COMPAT Peter Xu
2025-12-10 11:27 ` [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class Kevin Wolf
2025-12-10 11:52 ` Daniel P. Berrangé
2025-12-10 16:17 ` Peter Xu
2025-12-10 18:25 ` Vladimir Sementsov-Ogievskiy
2025-12-10 20:15 ` Peter Xu
2025-12-11 9:48 ` Daniel P. Berrangé
2025-12-11 15:09 ` Peter Xu
2025-12-11 15:26 ` Daniel P. Berrangé
2025-12-11 16:05 ` Peter Xu
2025-12-11 15:28 ` Akihiko Odaki
2025-12-11 15:57 ` Peter Xu [this message]
2025-12-12 5:38 ` Akihiko Odaki
2025-12-11 16:29 ` Cédric Le Goater
2025-12-11 17:14 ` Peter Xu
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=aTrp9o3d8pAapahL@x1.local \
--to=peterx@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=clg@redhat.com \
--cc=dave@treblig.org \
--cc=dtalexundeer@yandex-team.ru \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=jasowang@redhat.com \
--cc=jmarcin@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=vsementsov@yandex-team.ru \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).