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

[Xen-changelog] [xen-unstable] Skipping image name at start of command line is an



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1188398633 -3600
# Node ID 2eb38cefdcd934d7f1142f1ca4f29e118ca04926
# Parent  c868eab6c99baeefa8d2b200e6f8435054a16692
Skipping image name at start of command line is an
architecture-specific action. Definitely not required on IA64, for now
make it just x86 specific.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/setup.c |   32 +++++++++++++++++---------------
 xen/common/kernel.c  |    6 ------
 2 files changed, 17 insertions(+), 21 deletions(-)

diff -r c868eab6c99b -r 2eb38cefdcd9 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Wed Aug 29 15:02:41 2007 +0100
+++ b/xen/arch/x86/setup.c      Wed Aug 29 15:43:53 2007 +0100
@@ -429,10 +429,22 @@ void init_done(void)
     startup_cpu_idle_loop();
 }
 
+static char * __init cmdline_cook(char *p)
+{
+    p = p ? : "";
+    while ( *p == ' ' )
+        p++;
+    while ( (*p != ' ') && (*p != '\0') )
+        p++;
+    while ( *p == ' ' )
+        p++;
+    return p;
+}
+
 void __init __start_xen(unsigned long mbi_p)
 {
     char *memmap_type = NULL;
-    char __cmdline[] = "", *cmdline = __cmdline, *kextra;
+    char *cmdline, *kextra;
     unsigned long _initrd_start = 0, _initrd_len = 0;
     unsigned int initrdidx = 1;
     char *_policy_start = NULL;
@@ -451,8 +463,8 @@ void __init __start_xen(unsigned long mb
     set_intr_gate(TRAP_page_fault, &early_page_fault);
 
     /* Parse the command-line options. */
-    if ( (mbi->flags & MBI_CMDLINE) && (mbi->cmdline != 0) )
-        cmdline = __va(mbi->cmdline);
+    cmdline = cmdline_cook((mbi->flags & MBI_CMDLINE) ?
+                           __va(mbi->cmdline) : NULL);
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
         /*
@@ -1037,18 +1049,8 @@ void __init __start_xen(unsigned long mb
     {
         static char dom0_cmdline[MAX_GUEST_CMDLINE];
 
-        dom0_cmdline[0] = '\0';
-
-        if ( cmdline != NULL )
-        {
-            /* Skip past the image name and copy to a local buffer. */
-            while ( *cmdline == ' ' ) cmdline++;
-            if ( (cmdline = strchr(cmdline, ' ')) != NULL )
-            {
-                while ( *cmdline == ' ' ) cmdline++;
-                safe_strcpy(dom0_cmdline, cmdline);
-            }
-        }
+        cmdline = cmdline_cook(cmdline);
+        safe_strcpy(dom0_cmdline, cmdline);
 
         if ( kextra != NULL )
             /* kextra always includes exactly one leading space. */
diff -r c868eab6c99b -r 2eb38cefdcd9 xen/common/kernel.c
--- a/xen/common/kernel.c       Wed Aug 29 15:02:41 2007 +0100
+++ b/xen/common/kernel.c       Wed Aug 29 15:43:53 2007 +0100
@@ -32,12 +32,6 @@ void cmdline_parse(char *cmdline)
     int bool_assert;
 
     if ( p == NULL )
-        return;
-
-    /* Skip whitespace and the image name. */
-    while ( *p == ' ' )
-        p++;
-    if ( (p = strchr(p, ' ')) == NULL )
         return;
 
     for ( ; ; )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.