]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: Add support for ovmf firmware
authorJim Fehlig <jfehlig@suse.com>
Wed, 20 Apr 2016 21:14:35 +0000 (15:14 -0600)
committerJim Fehlig <jfehlig@suse.com>
Mon, 13 Jun 2016 20:13:17 +0000 (14:13 -0600)
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@suse.com>
src/libxl/libxl_conf.c

index 96f96354af541ab411106efd11bba30fa5ae5966..acb6594bc3f08e81a988ea34e55974037bb578de 100644 (file)
@@ -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,