All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Peter Xu" <peterx@redhat.com>,
	qemu-devel@nongnu.org,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Juraj Marcin" <jmarcin@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Sana Sharma" <sansshar@redhat.com>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Dr . David Alan Gilbert" <dave@treblig.org>
Subject: Re: [PATCH 2/4] qdev: Introduce helper object_apply_globals()
Date: Fri, 05 Jun 2026 12:06:55 -0300	[thread overview]
Message-ID: <878q8t6n74.fsf@suse.de> (raw)
In-Reply-To: <aiLhcXUxVQ1K_6xA@redhat.com>

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

> On Fri, Jun 05, 2026 at 11:44:47AM -0300, Fabiano Rosas wrote:
>> Daniel P. Berrangé <berrange@redhat.com> writes:
>> 
>> > On Thu, Jun 04, 2026 at 07:11:16PM -0400, Peter Xu wrote:
>> >> The helper allows one object to apply anything from -global command lines
>> >> to an object.
>> >> 
>> >> Signed-off-by: Peter Xu <peterx@redhat.com>
>> >> ---
>> >>  include/hw/core/qdev-properties.h | 1 +
>> >>  hw/core/qdev-properties.c         | 5 +++++
>> >>  2 files changed, 6 insertions(+)
>> >> 
>> >> diff --git a/include/hw/core/qdev-properties.h b/include/hw/core/qdev-properties.h
>> >> index eba5436e53..779acb31b6 100644
>> >> --- a/include/hw/core/qdev-properties.h
>> >> +++ b/include/hw/core/qdev-properties.h
>> >> @@ -268,6 +268,7 @@ const GlobalProperty *qdev_find_global_prop(Object *obj,
>> >>                                              const char *name);
>> >>  int qdev_prop_check_globals(void);
>> >>  void qdev_prop_set_globals(DeviceState *dev);
>> >> +void object_apply_globals(Object *obj);
>> >>  void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj,
>> >>                                      const char *name, const char *value);
>> >>  
>> >> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
>> >> index 8f870c85fc..a91c2ad101 100644
>> >> --- a/hw/core/qdev-properties.c
>> >> +++ b/hw/core/qdev-properties.c
>> >> @@ -1045,6 +1045,11 @@ void qdev_prop_set_globals(DeviceState *dev)
>> >>                                dev->hotplugged ? NULL : &error_fatal);
>> >>  }
>> >>  
>> >> +void object_apply_globals(Object *obj)
>> >> +{
>> >> +    object_apply_global_props(obj, global_props(), &error_fatal);
>> >> +}
>> >
>> > If a method has the "object_" prefix and takex "Object *" as its
>> > instance, then it needs to live in qom/object.c / include/qom/object.h
>> > but this again has the complexity of relying on the qdev Property
>> > struct.  This is really mixing qdev & qom layers together which I
>> > find pretty unpleasant.
>> >
>> 
>> True, but code like qdev_property_add_static() already mixes things up
>> quite a bit. Not that this is justification to mix it even more, of
>> course.
>
> That's not the same scenario as it is exclusively qdev code, using
> qdev_ name prefix and taking "Device *" not "Object *".
>

Reading your message again, I misinterpreted you as arguing against the
overall coupling of ObjectProperty and Property. I agree with the
specific point of the abstraction layers.

> With regards,
> Daniel


  reply	other threads:[~2026-06-05 15:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 23:11 [PATCH 0/4] migration/qdev: Remove TYPE_DEVICE dependency on migration object Peter Xu
2026-06-04 23:11 ` [PATCH 1/4] qdev: Pave way for exporting Property to be used in non-qdev Peter Xu
2026-06-05 10:53   ` Mark Cave-Ayland
2026-06-05 15:18     ` Fabiano Rosas
2026-06-05 14:39   ` Fabiano Rosas
2026-06-05 15:40     ` Peter Xu
2026-06-04 23:11 ` [PATCH 2/4] qdev: Introduce helper object_apply_globals() Peter Xu
2026-06-05  8:52   ` Daniel P. Berrangé
2026-06-05 14:44     ` Fabiano Rosas
2026-06-05 14:47       ` Daniel P. Berrangé
2026-06-05 15:06         ` Fabiano Rosas [this message]
2026-06-04 23:11 ` [PATCH 3/4] qdev: Refactor and rename of qdev_class_add_property() Peter Xu
2026-06-05  8:43   ` Daniel P. Berrangé
2026-06-05 15:21     ` Peter Xu
2026-06-04 23:11 ` [PATCH 4/4] migration: Remove dependency to TYPE_DEVICE Peter Xu
2026-06-05  8:30   ` Marc-André Lureau
2026-06-05  8:49     ` Daniel P. Berrangé
2026-06-05 15:36       ` 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=878q8t6n74.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=clg@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.caveayland@nutanix.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sansshar@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 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.