All of lore.kernel.org
 help / color / mirror / Atom feed
From: Attilio Rao <attilio.rao@citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH] [PATCH v2] Add the bios option
Date: Fri, 24 Feb 2012 18:32:02 +0000	[thread overview]
Message-ID: <4F47D7A2.2020709@citrix.com> (raw)
In-Reply-To: <20ea6f881776a8912dbe.1330107857@dhcp-3-145.uk.xensource.com>

It seems I have still to learn using the patchbomb extension properly 
with mercurial :)

[Patch v2] Add the bios option to specify the bios to load.

Please note 2 things:
- I've used the name of 'OVMF' rather than adding the arch postfix 
because we are going to make this code arch-size agnostic (in another patch)
- Other seems missing in xl.cfg.pod5, like firmware_override

Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
---

Differences wih previous patch:
- Renamed bios_override option into bios
- Made internally the bios value as an enumeration
- Added the documentation for the bios option in xl.cfg.pod.5

On 24/02/12 18:24, Attilio Rao wrote:
> diff -r adcd6ab160fa -r 20ea6f881776 docs/man/xl.cfg.pod.5
> --- a/docs/man/xl.cfg.pod.5	Thu Feb 23 10:29:27 2012 +0000
> +++ b/docs/man/xl.cfg.pod.5	Fri Feb 24 18:19:56 2012 +0000
> @@ -430,6 +430,12 @@ accept the defaults for these options wh
>
>   =over 4
>
> +=item B<bios="STRING">
> +
> +Load the specified BIOS in HVMLOADER. By default, HVMLOADER will try
> +to do a guess about the BIOS to run, but sometimes it may be useful
> +to force a different one, like OVMF UEFI.
> +
>   =item B<pae=BOOLEAN>
>
>   Hide or expose the IA32 Physical Address Extensions. These extensions
> diff -r adcd6ab160fa -r 20ea6f881776 tools/libxl/libxl_create.c
> --- a/tools/libxl/libxl_create.c	Thu Feb 23 10:29:27 2012 +0000
> +++ b/tools/libxl/libxl_create.c	Fri Feb 24 18:19:56 2012 +0000
> @@ -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 -r adcd6ab160fa -r 20ea6f881776 tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c	Thu Feb 23 10:29:27 2012 +0000
> +++ b/tools/libxl/libxl_dm.c	Fri Feb 24 18:19:56 2012 +0000
> @@ -66,6 +66,8 @@ const char *libxl__domain_device_model(l
>   static const char *libxl__domain_bios(libxl__gc *gc,
>                                   const libxl_domain_build_info *info)
>   {
> +    if (info->u.hvm.bios)
> +       return libxl_bios_types_to_string(info->u.hvm.bios);
>       switch (info->device_model_version) {
>       case 1: return "rombios";
>       case 2: return "seabios";
> diff -r adcd6ab160fa -r 20ea6f881776 tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Thu Feb 23 10:29:27 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Fri Feb 24 18:19:56 2012 +0000
> @@ -99,6 +99,12 @@ libxl_timer_mode = Enumeration("timer_mo
>       (3, "one_missed_tick_pending"),
>       ])
>
> +libxl_bios_types = Enumeration("bios_types", [
> +    (1, "rombios"),
> +    (2, "seabios"),
> +    (3, "ovmf"),
> +    ])
> +
>   #
>   # Complex libxl types
>   #
> @@ -228,6 +234,7 @@ libxl_domain_build_info = Struct("domain
>
>       ("u", KeyedUnion(None, libxl_domain_type, "type",
>                   [("hvm", Struct(None, [("firmware", string),
> +                                       ("bios", libxl_bios_types),
>                                          ("pae", bool),
>                                          ("apic", bool),
>                                          ("acpi", bool),
> diff -r adcd6ab160fa -r 20ea6f881776 tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c	Thu Feb 23 10:29:27 2012 +0000
> +++ b/tools/libxl/xl_cmdimpl.c	Fri Feb 24 18:19:56 2012 +0000
> @@ -704,6 +704,12 @@ static void parse_config_data(const char
>
>           xlu_cfg_replace_string (config, "firmware_override",
>                                   &b_info->u.hvm.firmware, 0);
> +        if (!xlu_cfg_get_string(config, "bios",&buf, 0)&&
> +            libxl_bios_types_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-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>    

  reply	other threads:[~2012-02-24 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 18:24 [PATCH] [PATCH v2] Add the bios option Attilio Rao
2012-02-24 18:32 ` Attilio Rao [this message]
2012-02-28 12:40 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F47D7A2.2020709@citrix.com \
    --to=attilio.rao@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.