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-ppc-devel

Re: [XenPPC] [PATCH] Change to add boot param delimiter " || "

To: Jerone Young <jyoung5@xxxxxxxxxx>
Subject: Re: [XenPPC] [PATCH] Change to add boot param delimiter " || "
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Wed, 06 Dec 2006 13:41:58 -0600
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 06 Dec 2006 11:42:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1165426651.5328.2.camel@thinkpad>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <1165360800.21685.9.camel@thinkpad> <0AAD6A67-44A4-476F-8C12-E940F132A67C@xxxxxxxxxxxxxx> <1165426651.5328.2.camel@thinkpad>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2006-12-06 at 11:37 -0600, Jerone Young wrote:
> Update patch with Jimi's suggestions:
> 
> Signed-off-by: Jerone Young <jyoung5@xxxxxxxxxx>
> 
> diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c
> --- a/xen/arch/powerpc/boot_of.c        Tue Oct 24 19:11:00 2006 -0400
> +++ b/xen/arch/powerpc/boot_of.c        Wed Dec 06 11:34:37 2006 -0600
> @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon
>      static module_t mods[4];
>      ulong mod0_start;
>      ulong mod0_size;
> -    static const char sepr[] = " -- ";
> +    static const char * sepr[] = {" -- ", " || "};
> +    int sepr_index = 0;
>      extern char dom0_start[] __attribute__ ((weak));
>      extern char dom0_size[] __attribute__ ((weak));
> -    const char *p;
> +    const char *p = NULL;
>      int mod;
>      void *oft;
> 
> @@ -1020,11 +1021,17 @@ static void * __init boot_of_module(ulon
> 
>      of_printf("%s: dom0 mod @ 0x%016x[0x%x]\n", __func__,
>                mods[mod].mod_start, mods[mod].mod_end);
> -    p = strstr((char *)(ulong)mbi->cmdline, sepr);
> +
> +    /* look for deliminator -- or || is delimator */

"delimiter"

> +    for(sepr_index; sepr_index < ARRAY_SIZE(sepr); sepr_index++){

Add a space after "for", and move the "sepr_index = 0" initialization
here please.

> +        p = strstr((char *)(ulong)mbi->cmdline, sepr[sepr_index]);
> +        if (p != NULL)
> +            break;
> +    }
> +
>      if (p != NULL) {
>          /* Xen proper should never know about the dom0 args.  */
> -        *(char *)p = '\0';
> -        p += sizeof (sepr) - 1;
> +        p += strlen(sepr[sepr_index]);
>          mods[mod].string = (u32)(ulong)p;
>          of_printf("%s: dom0 mod string: %s\n", __func__, p);
>      }

You've removed the code where we terminate Xen's arguments with a NULL
char.

Fix these issues and I'm quite happy with it.

-- 
Hollis Blanchard
IBM Linux Technology Center


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