[PATCH V3 6/6] libxl: Add support for ovmf firmware

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

 



Populate libxl_domain_build_info struct with bios and firmware
info from virDomainLoaderDef.

Note: Currently libxl only allows specifying the type of BIOS.
For type LIBXL_BIOS_TYPE_OVMF, the firmware path is configured
when building Xen using '--with-system-ovmf='. If not specified,
LIBXL_FIRMWARE_DIR/ovmf.bin is used. In the future, Xen will
support a user-specified firmware path. See

http://lists.xenproject.org/archives/html/xen-devel/2016-03/msg01628.html

Once that work is merged into xen.git, the libvirt libxl driver
will be able to honor a user-specified path. In the meantime use
the implicit path, which is tolerable since it is advertised in
domcapabilities.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
---
 src/libxl/libxl_conf.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 96f9635..acb6594 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -395,6 +395,19 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
             return -1;
 #endif
 
+        /*
+         * Currently libxl only allows specifying the type of BIOS.
+         * If the type is PFLASH, we assume OVMF and set libxl_bios_type
+         * to LIBXL_BIOS_TYPE_OVMF. The path to the OVMF firmware is
+         * configured when building Xen using '--with-system-ovmf='. If
+         * not specified, LIBXL_FIRMWARE_DIR/ovmf.bin is used. In the
+         * future, Xen will support a user-specified firmware path. See
+         * http://lists.xenproject.org/archives/html/xen-devel/2016-03/msg01628.html
+         */
+        if (def->os.loader &&
+            def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH)
+            b_info->u.hvm.bios = LIBXL_BIOS_TYPE_OVMF;
+
         if (def->emulator) {
             if (!virFileExists(def->emulator)) {
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-- 
2.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]