direct-io.hg

changeset 1784:bdafa1768678

bitkeeper revision 1.1084 (40f550b1_LIi9erer0DqFiK5Y96wdA)

Bugfix
author kaf24@scramble.cl.cam.ac.uk
date Wed Jul 14 15:26:41 2004 +0000 (2004-07-14)
parents 8f75eee1c448
children 002fc84add90
files tools/libxc/xc_linux_build.c xen/common/elf.c
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Wed Jul 14 15:02:34 2004 +0000
     1.2 +++ b/tools/libxc/xc_linux_build.c	Wed Jul 14 15:26:41 2004 +0000
     1.3 @@ -560,7 +560,7 @@ static int parseelfimage(char *elfbase,
     1.4      Elf_Phdr *phdr;
     1.5      Elf_Shdr *shdr;
     1.6      unsigned long kernstart = ~0UL, kernend=0UL;
     1.7 -    char *shstrtab, *guestinfo, *p;
     1.8 +    char *shstrtab, *guestinfo=NULL, *p;
     1.9      int h;
    1.10  
    1.11      if ( !IS_ELF(*ehdr) )
    1.12 @@ -608,13 +608,9 @@ static int parseelfimage(char *elfbase,
    1.13              return -EINVAL;
    1.14          }
    1.15  
    1.16 -        *pvirtstart = kernstart;
    1.17 -        if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    1.18 -            *pvirtstart = strtoul(p+10, &p, 0);
    1.19 -
    1.20          break;
    1.21      }
    1.22 -    if ( h == ehdr->e_shnum )
    1.23 +    if ( guestinfo == NULL )
    1.24      {
    1.25          ERROR("Not a Xen-ELF image: '__xen_guest' section not found.");
    1.26          return -EINVAL;
    1.27 @@ -639,6 +635,10 @@ static int parseelfimage(char *elfbase,
    1.28          return -EINVAL;
    1.29      }
    1.30  
    1.31 +    *pvirtstart = kernstart;
    1.32 +    if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    1.33 +        *pvirtstart = strtoul(p+10, &p, 0);
    1.34 +
    1.35      *pkernstart = kernstart;
    1.36      *pkernend   = kernend;
    1.37      *pkernentry = ehdr->e_entry;
     2.1 --- a/xen/common/elf.c	Wed Jul 14 15:02:34 2004 +0000
     2.2 +++ b/xen/common/elf.c	Wed Jul 14 15:26:41 2004 +0000
     2.3 @@ -27,7 +27,7 @@ int parseelfimage(char *elfbase,
     2.4      Elf_Phdr *phdr;
     2.5      Elf_Shdr *shdr;
     2.6      unsigned long kernstart = ~0UL, kernend=0UL;
     2.7 -    char *shstrtab, *guestinfo, *p;
     2.8 +    char *shstrtab, *guestinfo=NULL, *p;
     2.9      int h;
    2.10  
    2.11      if ( !IS_ELF(*ehdr) )
    2.12 @@ -75,13 +75,9 @@ int parseelfimage(char *elfbase,
    2.13              return -EINVAL;
    2.14          }
    2.15  
    2.16 -        *pvirtstart = kernstart;
    2.17 -        if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    2.18 -            *pvirtstart = simple_strtoul(p+10, &p, 0);
    2.19 -
    2.20          break;
    2.21      }
    2.22 -    if ( h == ehdr->e_shnum )
    2.23 +    if ( guestinfo == NULL )
    2.24      {
    2.25          printk("Not a Xen-ELF image: '__xen_guest' section not found.\n");
    2.26          return -EINVAL;
    2.27 @@ -106,6 +102,10 @@ int parseelfimage(char *elfbase,
    2.28          return -EINVAL;
    2.29      }
    2.30  
    2.31 +    *pvirtstart = kernstart;
    2.32 +    if ( (p = strstr(guestinfo, "VIRT_BASE=")) != NULL )
    2.33 +        *pvirtstart = simple_strtoul(p+10, &p, 0);
    2.34 +
    2.35      *pkernstart = kernstart;
    2.36      *pkernend   = kernend;
    2.37      *pkernentry = ehdr->e_entry;