[PATCH] bhyve: autofill NVRAM data for firmware='efi'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When a domain configured with "<os firmware='efi'/>", autofill not only
loader/firmware configuration, but also nvram.

This also fixes the `scripts/domain/405-ovmf-nvram-efi.t` test in
libvirt-tck for bhyve.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@xxxxxxxxx>
---
 src/bhyve/bhyve_firmware.c                              | 5 +++--
 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
index 36bca490b6..57ad0031b0 100644
--- a/src/bhyve/bhyve_firmware.c
+++ b/src/bhyve/bhyve_firmware.c
@@ -72,8 +72,9 @@ bhyveFirmwareEnsureNVRAM(virDomainDef *def,
         /* otherwise we want to reset and re-populate the definition */
         virObjectUnref(loader->nvram);
     } else {
-        /* Also do nothing if NVRAM is not requested */
-        return;
+        /* Only add nvram for "<os firmware='efi'/>" */
+        if (def->os.firmware != VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)
+            return;
     }
 
     loader->nvram = virStorageSourceNew();
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
index c87dc7d779..16b9c50535 100644
--- a/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
@@ -5,7 +5,7 @@ bhyve \
 -H \
 -P \
 -s 0:0,hostbridge \
--l bootrom,fakefirmwaredir/BHYVE_UEFI.fd \
+-l bootrom,fakefirmwaredir/BHYVE_UEFI.fd,fakenvramdir/bhyve_VARS.fd \
 -s 1:0,lpc \
 -s 2:0,ahci,hd:/tmp/freebsd.img \
 -s 3:0,virtio-net,faketapdev,mac=52:54:00:00:00:00 \
-- 
2.49.0



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux