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

[Xen-changelog] [xen-unstable] libxl, xl: Add the bios option to specify the bios to load



# HG changeset patch
# User Attilio Rao <attilio.rao@xxxxxxxxxx>
# Date 1330532738 0
# Node ID e439559f50eb284d05efd142c4322bef43c2e20b
# Parent  fa3f08ce6b75f8ff1c41bb254ea479de75583c9b
libxl, xl: Add the bios option to specify the bios to load

Signed-off-by: Attilio Rao <attilio.rao@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r fa3f08ce6b75 -r e439559f50eb docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5     Wed Feb 29 15:11:31 2012 +0000
+++ b/docs/man/xl.cfg.pod.5     Wed Feb 29 16:25:38 2012 +0000
@@ -430,6 +430,33 @@
 
 =over 4
 
+=item B<bios="STRING">
+
+Select the virtual firmware that is exposed to the guest.
+By default, a guess is made based on the device model, but sometimes
+it may be useful to request a different one, like UEFI.
+
+=over 4
+
+=item B<rombios>
+
+Loads ROMBIOS, a 16-bit x86 compatible BIOS. This is used by default
+when device_model_version=qemu-xen-traditional. This is the only BIOS
+option supported when device_model_version=qemu-xen-traditional. This is
+the BIOS used by all previous Xen versions.
+
+=item B<seabios>
+
+Loads SeaBIOS, a 16-bit x86 compatible BIOS. This is used by default
+with device_model_version=qemu-xen.
+
+=item B<ovmf>
+
+Loads OVMF, a standard UEFI firmware by Tianocore project.
+Requires device_model_version=qemu-xen.
+
+=back
+
 =item B<pae=BOOLEAN>
 
 Hide or expose the IA32 Physical Address Extensions. These extensions
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_create.c        Wed Feb 29 16:25:38 2012 +0000
@@ -89,6 +89,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->video_memkb = 8 * 1024;
         b_info->u.hvm.firmware = NULL;
+        b_info->u.hvm.bios = 0;
         b_info->u.hvm.pae = 1;
         b_info->u.hvm.apic = 1;
         b_info->u.hvm.acpi = 1;
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Wed Feb 29 16:25:38 2012 +0000
@@ -66,6 +66,8 @@
 static const char *libxl__domain_bios(libxl__gc *gc,
                                 const libxl_domain_build_info *info)
 {
+    if (info->u.hvm.bios)
+       return libxl_bios_type_to_string(info->u.hvm.bios);
     switch (info->device_model_version) {
     case 1: return "rombios";
     case 2: return "seabios";
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Wed Feb 29 16:25:38 2012 +0000
@@ -99,6 +99,12 @@
     (3, "one_missed_tick_pending"),
     ])
 
+libxl_bios_type = Enumeration("bios_type", [
+    (1, "rombios"),
+    (2, "seabios"),
+    (3, "ovmf"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -228,6 +234,7 @@
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware", string),
+                                       ("bios", libxl_bios_type),
                                        ("pae", bool),
                                        ("apic", bool),
                                        ("acpi", bool),
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Wed Feb 29 16:25:38 2012 +0000
@@ -703,6 +703,12 @@
 
         xlu_cfg_replace_string (config, "firmware_override",
                                 &b_info->u.hvm.firmware, 0);
+        if (!xlu_cfg_get_string(config, "bios", &buf, 0) &&
+            libxl_bios_type_from_string(buf, &b_info->u.hvm.bios)) {
+                fprintf(stderr, "ERROR: invalid value \"%s\" for \"bios\"\n",
+                    buf);
+                exit (1);
+        }
         if (!xlu_cfg_get_long (config, "pae", &l, 0))
             b_info->u.hvm.pae = l;
         if (!xlu_cfg_get_long (config, "apic", &l, 0))

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.