> On 10 Nov 2021, at 13:36, Julien Grall <[email protected]> wrote:
>
> Hi Luca,
>
> On 10/11/2021 13:05, Luca Fancellu wrote:
>> I thought having the EFI_FILE_HANDLE global in efi-boot.h was a “no go”, but
>> if it’s not then instead of
>> calling get_parent_handle in efi_check_dt_boot (that is the main issue with
>> EDK2+Grub2), we can do
>> something like this:
>
Hi Julien,
> fs_dir_handle is only used by callees of efi_check_boot_dt_boot(). So the
> global variable is not an option for me because the risk is not worth it (it
> is easy to misuse a global variable).
>
> Instead, I think fs_dir_handle should be an argument of
> allocate_module_file() and propagated up to the first call in
> efi_check_dt_boot().
>
Yes you are right, changing the interface of handle_dom0less_domain_node,
handle_module_node, allocate_module_file to host also an argument
EFI_FILE_HANDLE *dir_handle
avoids the use of the global, then the handle is requested in
allocate_module_file only once and closed in efi_check_dt_boot only if it’s not
null.
Cheers,
Luca
> Cheers,
>
> --
> Julien Grall