Hi,
> > +ObjectClass *module_object_class_by_name(const char *typename)
> > +{
> > + ObjectClass *oc;
> > +
> > + oc = object_class_by_name(typename);
> > +#ifdef CONFIG_MODULES
> > + if (!oc) {
> > + module_load_qom_one(typename);
> > + oc = object_class_by_name(typename);
> > + }
> > +#endif
>
> I'm wondering if there is any reason to only trigger the module load when
> you don't find the object class. You could simply call module_load_qom_one
> under #ifdef CONFIG_MODULES.
>
> Performance wise, I don't think this makes much of a difference, and it
> simplifies the logical flow IMO.
I expect the common case is that the object class is found and there is
rarely a need to actually load a module.
take care,
Gerd