aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAttilio Rao <attilio.rao@citrix.com>2012-02-29 16:25:38 +0000
committerAttilio Rao <attilio.rao@citrix.com>2012-02-29 16:25:38 +0000
commit1341ac67a346d29acf95b46ca849414f23f11dde (patch)
tree58bfa1099bd7a0a1e320fe61bab37bffda2706d0
parentd04b4856b5cbd9414cca4862216ac880680ab0c6 (diff)
downloadxen-1341ac67a346d29acf95b46ca849414f23f11dde.tar.gz
xen-1341ac67a346d29acf95b46ca849414f23f11dde.tar.bz2
xen-1341ac67a346d29acf95b46ca849414f23f11dde.zip
libxl, xl: Add the bios option to specify the bios to load
Signed-off-by: Attilio Rao <attilio.rao@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--docs/man/xl.cfg.pod.527
-rw-r--r--tools/libxl/libxl_create.c1
-rw-r--r--tools/libxl/libxl_dm.c2
-rw-r--r--tools/libxl/libxl_types.idl7
-rw-r--r--tools/libxl/xl_cmdimpl.c6
5 files changed, 43 insertions, 0 deletions
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 197503f088..55f7e75a16 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -430,6 +430,33 @@ accept the defaults for these options wherever possible.
=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 --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index deccf8827b..85a4a9ed70 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -89,6 +89,7 @@ int libxl_init_build_info(libxl_ctx *ctx,
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 --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 922b20b50a..d007bab24b 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -66,6 +66,8 @@ const char *libxl__domain_device_model(libxl__gc *gc,
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 --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 4f894cd39f..d6554b3074 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -99,6 +99,12 @@ libxl_timer_mode = Enumeration("timer_mode", [
(3, "one_missed_tick_pending"),
])
+libxl_bios_type = Enumeration("bios_type", [
+ (1, "rombios"),
+ (2, "seabios"),
+ (3, "ovmf"),
+ ])
+
#
# Complex libxl types
#
@@ -228,6 +234,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
("u", KeyedUnion(None, libxl_domain_type, "type",
[("hvm", Struct(None, [("firmware", string),
+ ("bios", libxl_bios_type),
("pae", bool),
("apic", bool),
("acpi", bool),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c7475f6101..d60e22b337 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -703,6 +703,12 @@ static void parse_config_data(const char *configfile_filename_report,
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))