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

[Xen-changelog] [xen-unstable] x86-64/EFI: allow chaining of config files


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 14 Sep 2012 10:55:29 +0000
  • Delivery-date: Fri, 14 Sep 2012 10:55:38 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1347437974 -7200
# Node ID 8c0aa97d529a55de2ab96be1a5a6e9ed6a9c6bf0
# Parent  ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
x86-64/EFI: allow chaining of config files

Namely when making use the CONFIG_XEN_COMPAT_* options in the legacy
Linux kernels, newer kernels may not be compatible with older
hypervisors, so trying to boot such a combination makes little sense.
Booting older kernels on newer hypervisors, however, has to always
work.

With the way xen.efi looks for its configuration file, allowing
individual configuration files to refer only to compatible kernels,
and referring from an older- to a newer-hypervisor one (the kernels
of which will, as said, necessarily be compatible with the older
hypervisor) allows to greatly reduce redundancy at least in
development environments where one frequently wants multiple
hypervisors and kernles to be installed in parallel.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r ac8f4afccd6c -r 8c0aa97d529a docs/misc/efi.markdown
--- a/docs/misc/efi.markdown    Wed Sep 12 10:17:34 2012 +0200
+++ b/docs/misc/efi.markdown    Wed Sep 12 10:19:34 2012 +0200
@@ -75,6 +75,13 @@ Specifies an XSM module to load.
 
 Specifies a CPU microcode blob to load.
 
+###`chain=<filename>`
+
+Specifies an alternate configuration file to use in case the specified section
+(and in particular its `kernel=` setting) can't be found in the default (or
+specified) configuration file. This is only meaningful in the [global] section
+and really not meant to be used together with the `-cfg=` command line option.
+
 Filenames must be specified relative to the location of the EFI binary.
 
 Extra options to be passed to Xen can also be specified on the command line,
diff -r ac8f4afccd6c -r 8c0aa97d529a xen/arch/x86/efi/boot.c
--- a/xen/arch/x86/efi/boot.c   Wed Sep 12 10:17:34 2012 +0200
+++ b/xen/arch/x86/efi/boot.c   Wed Sep 12 10:19:34 2012 +0200
@@ -809,7 +809,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY
     else
         section.s = get_value(&cfg, "global", "default");
 
-    name.s = get_value(&cfg, section.s, "kernel");
+    for ( ; ; )
+    {
+        name.s = get_value(&cfg, section.s, "kernel");
+        if ( name.s )
+            break;
+        name.s = get_value(&cfg, "global", "chain");
+        if ( !name.s )
+            break;
+        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+        cfg.addr = 0;
+        if ( !read_file(dir_handle, s2w(&name), &cfg) )
+        {
+            PrintStr(L"Chained configuration file '");
+            PrintStr(name.w);
+            efi_bs->FreePool(name.w);
+            blexit(L"'not found\r\n");
+        }
+        pre_parse(&cfg);
+        efi_bs->FreePool(name.w);
+    }
     if ( !name.s )
         blexit(L"No Dom0 kernel image specified\r\n");
     split_value(name.s);

_______________________________________________
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®.