On 9/6/22 13:59, Claudio Fontana wrote:
> On 9/6/22 11:53, Gerd Hoffmann wrote:
>>> In any case, the only thing that "mayfail" seems to control, is in 
>>> module_load_file, and is a single printf:
>>>
>>>     g_module = g_module_open(fname, flags);
>>>     if (!g_module) {
>>>         if (!mayfail) {
>>>             fprintf(stderr, "Failed to open module: %s\n",
>>>                     g_module_error());
>>>         }
>>>         ret = -EINVAL;
>>>         goto out;
>>>     }
>>>
>>>
>>> Weird.. Is someone building proprietary modules on top of QEMU?
>>
>> Nope.
>>
>> But modules have dependencies to stuff like pci bus, usb bus, vga which
>> might not be satisfied by some system emulators, and trying to load
>> those modules will fail then because of unresolved symbols.  If you drop
>> that 'make check' will log a pile of errors ...
>>
>> Dropping mayfail and return an 'Error' instead makes sense, then it is
>> up to the caller to report or not report the failure.  When calling down
>> from module_load_qom_all() you might want ignore errors for the reasons
>> outlined above, in most other caes it probably makes sense to report
>> them.
>>
>> take care,
>>   Gerd
>>
>>
> 
> Ah I noticed only now... I just sent a series, the module_load_qom_all() then 
> is maybe something to discuss further.
> 
> Thanks,
> 
> Claudio
> 

I noticed however that module_load_qom_all() does _not_ pass true for mayfail.

You changed this behavior in:

commit 9f4a0f0978cde9d8e27453b3f2d3679b53623c47
Author: Gerd Hoffmann <kra...@redhat.com>
Date:   Thu Jun 24 12:38:17 2021 +0200

    modules: use modinfo for qom load
    
    Use module database to figure which module implements a given QOM type.
    Drop hard-coded object list.
    
    Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
    Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>
    Reviewed-by: Jose R. Ziviani <jzivi...@suse.de>
    Message-Id: <20210624103836.2382472-16-kra...@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>


and from the patch I understand that this made the mayfail argument completely 
unnecessary, is that correct?

Thanks,

Claudio


Reply via email to