On 3/16/21 1:20 PM, Roman Bogorodskiy wrote:
Implement "<os firmware='efi'>" support for
bhyve driver.
As there are not really lot of options, try to find
"BHYVE_UEFI.fd" firmware which is installed by the
sysutils/uefi-edk2-bhyve FreeBSD port.
If not found, just use the first found firmware
in the firmwares directory (which is configurable via
config file).
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
Changes from v1:
- Fixed various leaks,
- Re-implemented testing using opendir() mock.
po/POTFILES.in | 1 +
src/bhyve/bhyve_domain.c | 5 +
src/bhyve/bhyve_firmware.c | 91 +++++++++++++++++++
src/bhyve/bhyve_firmware.h | 30 ++++++
src/bhyve/bhyve_process.c | 15 +++
src/bhyve/bhyve_process.h | 5 +
src/bhyve/bhyve_utils.h | 2 +
src/bhyve/meson.build | 1 +
tests/bhyvefirmwaredata/empty/.keepme | 0
.../three_firmwares/BHYVE_UEFI.fd | 0
.../three_firmwares/BHYVE_UEFI_CSM.fd | 0
.../three_firmwares/refind_x64.efi | 0
.../bhyvexml2argv-firmware-efi.args | 11 +++
.../bhyvexml2argv-firmware-efi.ldargs | 1 +
.../bhyvexml2argv-firmware-efi.xml | 22 +++++
tests/bhyvexml2argvmock.c | 33 +++++++
tests/bhyvexml2argvtest.c | 52 ++++++++---
17 files changed, 257 insertions(+), 12 deletions(-)
create mode 100644 src/bhyve/bhyve_firmware.c
create mode 100644 src/bhyve/bhyve_firmware.h
create mode 100644 tests/bhyvefirmwaredata/empty/.keepme
create mode 100644 tests/bhyvefirmwaredata/three_firmwares/BHYVE_UEFI.fd
create mode 100644 tests/bhyvefirmwaredata/three_firmwares/BHYVE_UEFI_CSM.fd
create mode 100644 tests/bhyvefirmwaredata/three_firmwares/refind_x64.efi
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Michal