[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] module: add Error arguments to module_load_one and modul
From: |
Claudio Fontana |
Subject: |
Re: [PATCH 2/3] module: add Error arguments to module_load_one and module_load_qom_one |
Date: |
Wed, 7 Sep 2022 11:31:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
On 9/7/22 09:36, Gerd Hoffmann wrote:
> Hi,
>
>> For this module_load_qom_all() maybe Gerd has a bit more context on
>> was should be the error reporting here?
>
> Use case for module_load_qom_all() is someone enumerating the qom
> objects available. So we load all modules known to have all object
> types registered and can return a complete list.
>
> It could be that some of the known modules are not there. Consider a
> distro packaging modules which depend on shared libraries into optional
> sub-rpms, to reduce the dependency chain of core qemu. So, with core
> qemu installed and (some of) the sub-rpms not installed
> module_load_qom_all() will obviously fail to load some modules.
>
> But I don't think those errors should be reported. The object types
> implemented by the missing modules will also be missing from the object
> type list ...
>
> Example: hw-usb-host.so is not installed.
>
> => 'qemu -device help' should IMHO not report the module load error
> and just not list the 'usb-host' device.
> => 'qemu -device usb-host' should report the module load error.
>
> take care,
> Gerd
>
Hi Gerd,
the thing is, we can distinguish between a module not being present (ENOENT,
ENOTDIR),
from a module being present, but failing to load.
So the "module not there" thing does not need to be treated separately, because
no warning/error will be emitted if the module is not there.
It is up to the user/caller to decide what to do with the condition "module not
there", error out and quit, continue on, etc.
Thanks this helped,
Claudio
- [PATCH 0/3] improve error handling for module load, Claudio Fontana, 2022/09/06
- [PATCH 1/3] module: removed unused function argument "mayfail", Claudio Fontana, 2022/09/06
- [PATCH 3/3] accel: abort if we fail to load the accelerator plugin, Claudio Fontana, 2022/09/06
- [PATCH 2/3] module: add Error arguments to module_load_one and module_load_qom_one, Claudio Fontana, 2022/09/06
- Re: [PATCH 2/3] module: add Error arguments to module_load_one and module_load_qom_one, Claudio Fontana, 2022/09/07
- Re: [PATCH 2/3] module: add Error arguments to module_load_one and module_load_qom_one, Richard Henderson, 2022/09/08