On 24/11/20 20:08, Eduardo Habkost wrote:
Not a big advantage I agree,
I think however there is one, in using the existing framework that exists, for
the purposes that it was built for.
As I understand it, the global module init framework is supposed to mark the
major initialization steps,
and this seems to fit the bill.
That seems to be the main source of disagreement. I don't agree
that's the purpose of module_init().
The module init framework is used to unconditionally register
module-provided entities like option names, QOM types, block
drivers, trace events, etc. The entities registered by module
init functions represent a passive dynamically loadable piece of
code.
Indeed. Think of module_init() as C++ global constructors.
Anything that has an "if" does not belong in module_init.
If you look at my review of the previous versions, I was not necessarily
against MODULE_INIT_ACCEL_CPU, but I was (and am) strongly against
calling it in the middle of the machine creation sequence.
Paolo