direct-io.hg

changeset 2504:94600c6f4011

bitkeeper revision 1.1159.79.7 (414ff215B9qHlFD0mQm03ssF02V-uA)

Strip image name from DOM0 cmdline.
author kaf24@freefall.cl.cam.ac.uk
date Tue Sep 21 09:19:17 2004 +0000 (2004-09-21)
parents 691d8544fd52
children 27a319ede628
files xen/arch/x86/domain.c xen/common/kernel.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Mon Sep 20 16:58:24 2004 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Tue Sep 21 09:19:17 2004 +0000
     1.3 @@ -862,7 +862,7 @@ int construct_dom0(struct domain *p,
     1.4      zap_low_mappings(); /* Do the same for the idle page tables. */
     1.5      
     1.6      /* Give up the VGA console if DOM0 is configured to grab it. */
     1.7 -    console_endboot(strstr(cmdline, "tty0") != NULL);
     1.8 +    console_endboot(cmdline && strstr(cmdline, "tty0"));
     1.9  
    1.10      /* DOM0 gets access to everything. */
    1.11      physdev_init_dom0(p);
     2.1 --- a/xen/common/kernel.c	Mon Sep 20 16:58:24 2004 +0000
     2.2 +++ b/xen/common/kernel.c	Tue Sep 21 09:19:17 2004 +0000
     2.3 @@ -148,7 +148,7 @@ void cmain(multiboot_info_t *mbi)
     2.4      {
     2.5          unsigned char *opt_end, *opt;
     2.6          while ( *cmdline == ' ' ) cmdline++;
     2.7 -        cmdline = strchr(cmdline, ' ');
     2.8 +        cmdline = strchr(cmdline, ' '); /* skip the image name */
     2.9          while ( cmdline != NULL )
    2.10          {
    2.11              while ( *cmdline == ' ' ) cmdline++;
    2.12 @@ -326,6 +326,15 @@ void cmain(multiboot_info_t *mbi)
    2.13  
    2.14      shadow_mode_init();
    2.15  
    2.16 +    /* Grab the DOM0 command line. Skip past the image name. */
    2.17 +    cmdline = (unsigned char *)(mod[0].string ? __va(mod[0].string) : NULL);
    2.18 +    if ( cmdline != NULL )
    2.19 +    {
    2.20 +        while ( *cmdline == ' ' ) cmdline++;
    2.21 +        if ( (cmdline = strchr(cmdline, ' ')) != NULL )
    2.22 +            while ( *cmdline == ' ' ) cmdline++;
    2.23 +    }
    2.24 +
    2.25      /*
    2.26       * We're going to setup domain0 using the module(s) that we stashed safely
    2.27       * above our heap. The second module, if present, is an initrd ramdisk.
    2.28 @@ -338,7 +347,7 @@ void cmain(multiboot_info_t *mbi)
    2.29                          (mod[1].mod_start-mod[0].mod_start),
    2.30                          (mbi->mods_count == 1) ? 0 :
    2.31                          mod[mbi->mods_count-1].mod_end - mod[1].mod_start,
    2.32 -                        __va(mod[0].string)) != 0)
    2.33 +                        cmdline) != 0)
    2.34          panic("Could not set up DOM0 guest OS\n");
    2.35  
    2.36      /* The stash space for the initial kernel image can now be freed up. */