On 4/29/2026 1:46 AM, Daniel P. Berrangé wrote:
> On Wed, Apr 29, 2026 at 12:36:03PM +0400, [email protected] wrote:
>> On Tue, 28 Apr 2026 16:45:16 -0700, Pierrick Bouvier 
>> <[email protected]> wrote:
>>> diff --git a/system/vl.c b/system/vl.c
>>> index 0e1fc217b4f..b4a5ea6f857 100644
>>> --- a/system/vl.c
>>> +++ b/system/vl.c
>>> @@ -2889,6 +2889,9 @@ void qemu_init(int argc, char **argv)
>>>      os_setup_limits();
>>>  
>>>      module_init_info(qemu_modinfo);
>>> +    /* We need to initialize QOM first to detect target */
>>> +    module_call_init(MODULE_INIT_QOM);
>>> +
>>>      module_allow_arch(target_name());
>>
>> This change is not trivial. By moving the call here, we lose the
>> initializations from qemu_init_subsystems(). Verifying that all
>> type_init() code is safe to run without it is a tedious task. It might
>> be better to introduce a new MODULE_INIT_TARGET_INFO instead
>

That seems like the right approach, thanks!

> I'd be inclined to have a MODULE_INIT_QOM_EARLY, along with a
> type_init_early(), so we're not presuming target info is the only
> use case for earlier init.
>

I feel that if we need such behavior, we can introduce another step when
needed. For the current scenario, it's really target-info vs all other
types, so it makes sense to reflect that in the name. Thus I would
prefer to follow Daniel naming for this one, if it works for you.

> Regards,
> Daniel
> 

Thanks,
Pierrick

Reply via email to