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-changelog

[Xen-changelog] [xen-unstable] Skipping image name at start of command l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Skipping image name at start of command line is an
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Sep 2007 09:13:22 -0700
Delivery-date: Fri, 07 Sep 2007 09:20:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Skipping image name at start of command line is an, Xen patchbot-unstable <=