On 5/9/2026 8:01 AM, Richard Henderson wrote:
> On 5/8/26 19:54, Pierrick Bouvier wrote:
>> +#define TYPE_TARGET_INFO_TARGET TYPE_TARGET_INFO"-"TARGET_NAME
> 
> I guess avoiding TARGET_NAME can wait until we actually build a single
> binary.
>

The point of this series is to prepare this now, as we already have
other patches (not yet posted) to link several architectures.
I can name it target-info-target for now, but I'm not sure what we gain
from this to be honest, we'll need TARGET_NAME in the end.

>> +typedef struct TargetInfoQomTarget {
>> +    TargetInfoQom parent;
>> +} TargetInfoQomTarget;
>> +
>> +typedef struct TargetInfoQomTargetClass {
>> +    TargetInfoQomClass parent_class;
>> +} TargetInfoQomTargetClass;
>> +
>> +OBJECT_DECLARE_TYPE(TargetInfoQomTarget, TargetInfoQomTargetClass,
>> TARGET_INFO_TARGET)
> 
> Since neither the object nor class are actually used; you don't need these.
> 
>> +static void target_info_qom_class_init(ObjectClass *oc, const void *
>> data)  \
>> +{                                                                           
>> \
>> +    TargetInfoQomTargetClass *klass =
>> TARGET_INFO_TARGET_CLASS(oc);         \
>> +    klass->parent_class.target_info =
>> &ti_var;                              \
>> +}                                                                           
>> \
> 
> This belongs in vl.c as target_info_parent_type.class_base_init.
> 
>> +static const TypeInfo target_info_qom_target_type_info =
>> {                  \
>> +    .name =
>> TYPE_TARGET_INFO_TARGET,                                        \
>> +    .parent =
>> TYPE_TARGET_INFO,                                             \
>> +    .instance_size =
>> sizeof(TargetInfoQomTarget),                           \
>> +    .class_size =
>> sizeof(TargetInfoQomTargetClass),                         \
>> +    .class_init =
>> target_info_qom_class_init,                               \
>> +    .abstract =
>> false,                                                      \
>> +};                                                                          
>> \
> 
> This reduces to just name, parent, and class_data.
> You don't need sizes, class_init, or abstract.
> 
> 
> r~

The rest of the patch is the same as v4, I added a new patch (6) to
implement what you asked. I'll squash it in this patch once you're ok.

Regards,
Pierrick

Reply via email to