[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] accel: print an error message and exit if plugin not loaded
From: |
Claudio Fontana |
Subject: |
Re: [PATCH] accel: print an error message and exit if plugin not loaded |
Date: |
Tue, 6 Sep 2022 14:14:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
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 <kraxel@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 <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jose R. Ziviani <jziviani@suse.de>
Message-Id: <20210624103836.2382472-16-kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
and from the patch I understand that this made the mayfail argument completely
unnecessary, is that correct?
Thanks,
Claudio
- [PATCH] accel: print an error message and exit if plugin not loaded, Claudio Fontana, 2022/09/05
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Richard Henderson, 2022/09/05
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Claudio Fontana, 2022/09/05
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Claudio Fontana, 2022/09/05
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Richard Henderson, 2022/09/05
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Gerd Hoffmann, 2022/09/06
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Claudio Fontana, 2022/09/06
- Re: [PATCH] accel: print an error message and exit if plugin not loaded,
Claudio Fontana <=
- Re: [PATCH] accel: print an error message and exit if plugin not loaded, Gerd Hoffmann, 2022/09/07