All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Anton Johansson" <anjo@rev.ng>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH 4/6] qom/object: add object_class_get_list_by_name_prefix
Date: Wed, 29 Apr 2026 09:48:22 +0100	[thread overview]
Message-ID: <afHF1nf_FaBAt6mr@redhat.com> (raw)
In-Reply-To: <177745176385.2166241.2869123011864084966.b4-review@b4>

On Wed, Apr 29, 2026 at 12:36:03PM +0400, marcandre.lureau@redhat.com wrote:
> On Tue, 28 Apr 2026 16:45:17 -0700, Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> wrote:
> > diff --git a/include/qom/object.h b/include/qom/object.h
> > index 510885218ba..a6d7b3874a7 100644
> > --- a/include/qom/object.h
> > +++ b/include/qom/object.h
> > @@ -1033,6 +1033,19 @@ GSList *object_class_get_list(const char *implements_type,
> >  GSList *object_class_get_list_sorted(const char *implements_type,
> >                                bool include_abstract);
> >  
> > +/**
> > + * object_class_get_list:
> 
> Should be "object_class_get_list_by_name_prefix:".
> 
> > + * @name_prefix: Name prefix for type to filter for.
> > + * @include_abstract: Whether to include abstract classes.
> > + *
> > + * To the opposite of object_class_get_list, only matching types are
> 
> Suggest "Unlike object_class_get_list,"
> 
> >
> > diff --git a/qom/object.c b/qom/object.c
> > index f981e270440..14527108a2e 100644
> > --- a/qom/object.c
> > +++ b/qom/object.c
> > @@ -1062,6 +1062,30 @@ static void object_class_foreach_tramp(gpointer key, gpointer value,
> >      data->fn(k, data->opaque);
> >  }
> >  
> > +static void object_class_foreach_match_name_prefix(gpointer key, gpointer value,
> > +                                                   gpointer opaque)
> > +{
> > +    OCFData *data = opaque;
> > +    TypeImpl *type = value;
> > +    ObjectClass *k;
> > +
> > +    const char *name_prefix = data->implements_type;
> 
> Perhaps the "implements_type" field should be renamed.
> 
> > [ ... skip 11 lines ... ]
> > +    }
> > +
> > +    data->fn(k, data->opaque);
> > +}
> > +
> >  void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
> 
> I wonder if we introduce MODULE_INIT_TARGET_INFO, is this all needed?
> since only TargetInfo types would be registered..

Yeah, i feel like this patch should be redundant if we provide  a
separate initializer for early types to get registered.

Daniel



  reply	other threads:[~2026-04-29  8:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 23:45 [PATCH 0/6] single-binary: deduplicate target_info() Pierrick Bouvier
2026-04-28 23:45 ` [PATCH 1/6] target-info: extract target_info() definition in target-info-init.h Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-28 23:45 ` [PATCH 2/6] target-info: introduce TargetInfo in QOM Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-29 18:22     ` Pierrick Bouvier
2026-04-28 23:45 ` [PATCH 3/6] system/vl: initialize QOM first Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-29  8:46     ` Daniel P. Berrangé
2026-04-29 21:23       ` Pierrick Bouvier
2026-04-28 23:45 ` [PATCH 4/6] qom/object: add object_class_get_list_by_name_prefix Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-29  8:48     ` Daniel P. Berrangé [this message]
2026-04-29 21:20       ` Pierrick Bouvier
2026-04-28 23:45 ` [PATCH 5/6] target-info-qom: detect target from QOM Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-28 23:45 ` [PATCH 6/6] target-info: replace target_info() in system-mode Pierrick Bouvier
2026-04-29  8:36   ` marcandre.lureau
2026-04-30  4:00 ` [PATCH 0/6] single-binary: deduplicate target_info() Pierrick Bouvier

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=afHF1nf_FaBAt6mr@redhat.com \
    --to=berrange@redhat.com \
    --cc=anjo@rev.ng \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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.