WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 2 of 3] Enable UEFI BIOS(OVMF) support in Xen-uns

To: Bei Guan <gbtju85@xxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 3] Enable UEFI BIOS(OVMF) support in Xen-unstable HVM
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Fri, 22 Jul 2011 17:44:35 +0100
Cc: edk2-devel@xxxxxxxxxxxxxxxxxxxxx, Jordan Justen <jljusten@xxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxx>, Andrei Warkentin <andreiw@xxxxxxxxxxxx>
Delivery-date: Fri, 22 Jul 2011 09:46:52 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=M5hhmcMt9bcpZ8DetKP4M3AdKQILLfwyxnHyGA0cbhg=; b=BsOZW3l1Kfy3GCP1GcvnyQNOgSNd4vTQp/73MqmS41KIjvgmgKXRGu9jXHabs3n279 CutNfis+5+eUuVxA1vHDh2tbUneIm5Jva0xn8YzvvqA+l+05K5CBxdtqaP0aHlql2CR3 fdDVdqbf9GVmziPCUzwUZu+9GublcZVwWoVVI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAEQjb-SRJ7243mf0cEHZPUpt_hfXcBdZgs1AGL_Ep144HpRkrg@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxIjqNZV192rkJp/kudGh67nkgDwA==
Thread-topic: [Xen-devel] [PATCH 2 of 3] Enable UEFI BIOS(OVMF) support in Xen-unstable HVM
User-agent: Microsoft-Entourage/12.30.0.110427
On 22/07/2011 17:27, "Bei Guan" <gbtju85@xxxxxxxxx> wrote:

> # HG changeset patch
> # User gbtju85@xxxxxxxxx
> #
> 
> Xen: Expose hvmloader/bios in libxl and xend.
> 
> Exposes the hvmloader/bios xenstore key in libxl and xend,
> so firmware loaded can be overriden (choices: rombios, seabios
> ovmf-ia32, ovmf-x64).

There's already some BIOS-configuration logic in libxl (see
libxl__domain_bios()) which I would assume you hook up to. Ian Campbell
would know better -- he wrote it.

I'd probably prefer to let xend grow obsolete quietly than add further
features. Noone's maintaining it to fix it up if new features break it. No
strong opinion on that though, it's up to the tools maintainers.

 -- Keir

> Sign-off-by: Bei Guan <gbtju85@xxxxxxxxx>
> 
> diff -r e298ce67777e tools/libxl/libxl.idl
> --- a/tools/libxl/libxl.idl    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/libxl/libxl.idl    Fri Jul 22 23:00:20 2011 +0800
> @@ -137,6 +137,7 @@
>                                              
>  libxl_domain_create_info = Struct("domain_create_info",[
>      ("hvm",          bool),
> +    ("hvmbios",      string),
>      ("hap",          bool),
>      ("oos",          bool),
>      ("ssidref",      uint32),
> diff -r e298ce67777e tools/libxl/libxl_create.c
> --- a/tools/libxl/libxl_create.c    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/libxl/libxl_create.c    Fri Jul 22 23:00:20 2011 +0800
> @@ -377,6 +377,10 @@
>      if (info->poolname)
>          xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/pool_name", vm_path),
> info->poolname, strlen(info->poolname));
>  
> +    if (info->hvmbios){
> +        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/hvmloader/bios",
> dom_path), info->hvmbios, strlen(info->hvmbios));
> +    }
> +
>      libxl__xs_writev(gc, t, dom_path, info->xsdata);
>      libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path),
> info->platformdata);
>  
> diff -r e298ce67777e tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/libxl/libxl_dm.c    Fri Jul 22 23:00:20 2011 +0800
> @@ -783,6 +783,7 @@
>      char *vm_path;
>      char **pass_stuff;
>      const char *dm;
> +    char *custom_bios;
>  
>      if (info->device_model_stubdomain) {
>          libxl_device_vfb vfb;
> @@ -814,10 +815,13 @@
>          goto out;
>      }
>  
> -    path = libxl__sprintf(gc, "/local/domain/%d/hvmloader", info->domid);
> -    xs_mkdir(ctx->xsh, XBT_NULL, path);
> -    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/bios", path),
> -                    "%s", libxl__domain_bios(gc, info));
> +    custom_bios = libxl__xs_read(gc, XBT_NULL, libxl__sprintf(gc,
> "/local/domain/%d/hvmloader/bios", info->domid));
> +    if (!custom_bios) {
> +        path = libxl__sprintf(gc, "/local/domain/%d/hvmloader", info->domid);
> +        xs_mkdir(ctx->xsh, XBT_NULL, path);
> +        libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/bios", path),
> +                        "%s", libxl__domain_bios(gc, info));
> +    }
>  
>      path = libxl__sprintf(gc, "/local/domain/0/device-model/%d",
> info->domid);
>      xs_mkdir(ctx->xsh, XBT_NULL, path);
> diff -r e298ce67777e tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/libxl/xl_cmdimpl.c    Fri Jul 22 23:00:20 2011 +0800
> @@ -553,6 +553,10 @@
>          }
>      }
>  
> +    if (!xlu_cfg_get_string (config, "hvmbios", &buf)){
> +        c_info->hvmbios = strdup(buf);
> +    }
> +
>      c_info->hvm = 0;
>      if (!xlu_cfg_get_string (config, "builder", &buf) &&
>          !strncmp(buf, "hvm", strlen(buf)))
> diff -r e298ce67777e tools/python/xen/xend/XendConfig.py
> --- a/tools/python/xen/xend/XendConfig.py    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/python/xen/xend/XendConfig.py    Fri Jul 22 23:00:20 2011 +0800
> @@ -153,6 +153,7 @@
>      'fdb': str,
>      'keymap': str,
>      'isa' : int,
> +    'hvmbios' : str,
>      'localtime': int,
>      'monitor': int,
>      'monitor_path': str,
> diff -r e298ce67777e tools/python/xen/xend/XendDomainInfo.py
> --- a/tools/python/xen/xend/XendDomainInfo.py    Mon Jul 18 14:38:31 2011
> +0100
> +++ b/tools/python/xen/xend/XendDomainInfo.py    Fri Jul 22 23:00:20 2011
> +0800
> @@ -1789,6 +1789,10 @@
>          if self.info.has_key('security_label'):
>              f('security_label', self.info <http://self.info>
> ['security_label'])
>  
> +        hvm = self.info.is_hvm()
> +        if hvm and self.info <http://self.info> ["platform"].get("hvmbios")
> is not None:
> +            f('hvmloader/bios', self.info <http://self.info>
> ["platform"].get("hvmbios"))
> +
>          to_store.update(self._vcpuDomDetails())
>  
>          log.debug("Storing domain details: %s", scrub_password(to_store))
> diff -r e298ce67777e tools/python/xen/xm/create.py
> --- a/tools/python/xen/xm/create.py    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/python/xen/xm/create.py    Fri Jul 22 23:00:20 2011 +0800
> @@ -168,6 +168,10 @@
>            fn=set_value, default=None,
>            use="Path to kernel image.")
>  
> +gopts.var('hvmbios', val='HVMBIOS',
> +          fn=set_value, default=None,
> +          use="Type of firmware to load in HVM mode")
> +
>  gopts.var('ramdisk', val='FILE',
>            fn=set_value, default='',
>            use="Path to ramdisk.")
> @@ -1084,7 +1088,7 @@
>               'device_model', 'display',
>               'fda', 'fdb',
>               'gfx_passthru', 'guest_os_type',
> -             'hap', 'hpet',
> +             'hap', 'hpet', 'hvmbios',
>               'isa',
>               'keymap',
>               'localtime',
> @@ -1143,7 +1147,7 @@
>                     'on_reboot', 'on_crash', 'features', 'on_xend_start',
>                     'on_xend_stop', 'target', 'cpuid', 'cpuid_check',
>                     'machine_address_size', 'suppress_spurious_page_faults',
> -                   'description'])
> +                   'description' ])
>  
>      vcpu_conf()
>      if vals.uuid is not None:
> diff -r e298ce67777e tools/python/xen/xm/xenapi_create.py
> --- a/tools/python/xen/xm/xenapi_create.py    Mon Jul 18 14:38:31 2011 +0100
> +++ b/tools/python/xen/xm/xenapi_create.py    Fri Jul 22 23:00:20 2011 +0800
> @@ -1090,6 +1090,7 @@
>              'fda',
>              'fdb',
>              'keymap',
> +            'hvmbios',
>              'isa',
>              'localtime',
>              'monitor',
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>