[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 02/10] object: qom module support
From: |
Gerd Hoffmann |
Subject: |
Re: [PATCH v5 02/10] object: qom module support |
Date: |
Tue, 21 Jul 2020 16:26:10 +0200 |
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