On Tue, 28 Apr 2026 16:45:17 -0700, Pierrick Bouvier 
<[email protected]> 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..

Suggest: "Unlike object_class_get_list,"

Suggest: "Unlike object_class_get_list,"

-- 
Marc-André Lureau <[email protected]>


Reply via email to