ia64/xen-unstable

changeset 6139:38bee85ddeb8

merge
author kaf24@firebug.cl.cam.ac.uk
date Fri Aug 12 13:29:57 2005 +0000 (2005-08-12)
parents f6d6d17eaeb5 1fb1877ed6d1
children 7c2fdcb2c933
files linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c tools/libxc/Makefile tools/libxc/xc_core.c tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c tools/libxc/xc_load_elf.c tools/libxc/xc_ptrace.c tools/libxc/xc_vmx_build.c xen/arch/ia64/xentime.c xen/arch/x86/time.c xen/include/public/dom0_ops.h xen/include/public/xen.h xen/include/xen/time.h
line diff
     2.1 --- a/tools/libxc/Makefile	Fri Aug 12 13:06:23 2005 +0000
     2.2 +++ b/tools/libxc/Makefile	Fri Aug 12 13:29:57 2005 +0000
     2.3 @@ -7,7 +7,7 @@ INSTALL_DIR	= $(INSTALL) -d -m0755
     2.4  MAJOR    = 3.0
     2.5  MINOR    = 0
     2.6  
     2.7 -CC       = gcc
     2.8 +CC       = sparse
     2.9  
    2.10  XEN_ROOT = ../..
    2.11  include $(XEN_ROOT)/tools/Rules.mk
     3.1 --- a/tools/libxc/xc_core.c	Fri Aug 12 13:06:23 2005 +0000
     3.2 +++ b/tools/libxc/xc_core.c	Fri Aug 12 13:29:57 2005 +0000
     3.3 @@ -43,7 +43,7 @@ xc_domain_dumpcore(int xc_handle,
     3.4  		goto error_out;
     3.5  	}
     3.6  	
     3.7 -	if ((dump_mem_start = malloc(DUMP_INCREMENT*PAGE_SIZE)) == 0) {
     3.8 +	if ((dump_mem_start = malloc(DUMP_INCREMENT*PAGE_SIZE)) == NULL) {
     3.9  		PERROR("Could not allocate dump_mem");
    3.10  		goto error_out;
    3.11  	}
    3.12 @@ -108,9 +108,8 @@ xc_domain_dumpcore(int xc_handle,
    3.13  	free(dump_mem_start);
    3.14  	return 0;
    3.15   error_out:
    3.16 -	if (dump_fd)
    3.17 +	if (dump_fd != -1)
    3.18  		close(dump_fd);
    3.19 -	if (dump_mem_start)
    3.20 -		free(dump_mem_start);
    3.21 +	free(dump_mem_start);
    3.22  	return -1;
    3.23  }
     4.1 --- a/tools/libxc/xc_linux_build.c	Fri Aug 12 13:06:23 2005 +0000
     4.2 +++ b/tools/libxc/xc_linux_build.c	Fri Aug 12 13:29:57 2005 +0000
     4.3 @@ -318,8 +318,7 @@ static int setup_guest(int xc_handle,
     4.4      return 0;
     4.5  
     4.6   error_out:
     4.7 -    if ( page_array != NULL )
     4.8 -        free(page_array);
     4.9 +    free(page_array);
    4.10      return -1;
    4.11  }
    4.12  #else /* x86 */
    4.13 @@ -616,10 +615,8 @@ static int setup_guest(int xc_handle,
    4.14      return 0;
    4.15  
    4.16   error_out:
    4.17 -    if ( mmu != NULL )
    4.18 -        free(mmu);
    4.19 -    if ( page_array != NULL )
    4.20 -        free(page_array);
    4.21 +    free(mmu);
    4.22 +    free(page_array);
    4.23      return -1;
    4.24  }
    4.25  #endif
    4.26 @@ -719,8 +716,7 @@ int xc_linux_build(int xc_handle,
    4.27          close(initrd_fd);
    4.28      if ( initrd_gfd )
    4.29          gzclose(initrd_gfd);
    4.30 -    if ( image != NULL )
    4.31 -        free(image);
    4.32 +    free(image);
    4.33  
    4.34  #ifdef __ia64__
    4.35      /* based on new_thread in xen/arch/ia64/domain.c */
    4.36 @@ -806,8 +802,7 @@ int xc_linux_build(int xc_handle,
    4.37          gzclose(initrd_gfd);
    4.38      else if ( initrd_fd >= 0 )
    4.39          close(initrd_fd);
    4.40 -    if ( image != NULL )
    4.41 -        free(image);
    4.42 +    free(image);
    4.43  
    4.44      return -1;
    4.45  }
     5.1 --- a/tools/libxc/xc_linux_restore.c	Fri Aug 12 13:06:23 2005 +0000
     5.2 +++ b/tools/libxc/xc_linux_restore.c	Fri Aug 12 13:29:57 2005 +0000
     5.3 @@ -32,7 +32,7 @@
     5.4  #define PPRINTF(_f, _a...)
     5.5  #endif
     5.6  
     5.7 -ssize_t
     5.8 +static ssize_t
     5.9  read_exact(int fd, void *buf, size_t count)
    5.10  {
    5.11      int r = 0, s;
    5.12 @@ -607,12 +607,9 @@ int xc_linux_restore(int xc_handle, int 
    5.13   out:
    5.14      if ( (rc != 0) && (dom != 0) )
    5.15          xc_domain_destroy(xc_handle, dom);
    5.16 -    if ( mmu != NULL )
    5.17 -        free(mmu);
    5.18 -    if ( pfn_to_mfn_table != NULL )
    5.19 -        free(pfn_to_mfn_table);
    5.20 -    if ( pfn_type != NULL )
    5.21 -        free(pfn_type);
    5.22 +    free(mmu);
    5.23 +    free(pfn_to_mfn_table);
    5.24 +    free(pfn_type);
    5.25  
    5.26      DPRINTF("Restore exit with rc=%d\n", rc);
    5.27      return rc;
     6.1 --- a/tools/libxc/xc_linux_save.c	Fri Aug 12 13:06:23 2005 +0000
     6.2 +++ b/tools/libxc/xc_linux_save.c	Fri Aug 12 13:29:57 2005 +0000
     6.3 @@ -136,7 +136,7 @@ static long long tv_to_us( struct timeva
     6.4      return (new->tv_sec * 1000000) + new->tv_usec;
     6.5  }
     6.6  
     6.7 -static long long llgettimeofday()
     6.8 +static long long llgettimeofday( void )
     6.9  {
    6.10      struct timeval now;
    6.11      gettimeofday(&now, NULL);
    6.12 @@ -312,9 +312,9 @@ static int analysis_phase( int xc_handle
    6.13  }
    6.14  
    6.15  
    6.16 -int suspend_and_state(int xc_handle, int io_fd,	int dom,	      
    6.17 -                      xc_dominfo_t *info,
    6.18 -                      vcpu_guest_context_t *ctxt)
    6.19 +static int suspend_and_state(int xc_handle, int io_fd,	int dom,	      
    6.20 +                             xc_dominfo_t *info,
    6.21 +                             vcpu_guest_context_t *ctxt)
    6.22  {
    6.23      int i=0;
    6.24      char ans[30];
    6.25 @@ -1051,20 +1051,11 @@ int xc_linux_save(int xc_handle, int io_
    6.26      if(live_mfn_to_pfn_table) 
    6.27          munmap(live_mfn_to_pfn_table, PAGE_SIZE*1024);
    6.28  
    6.29 -    if (pfn_type != NULL) 
    6.30 -        free(pfn_type);
    6.31 -
    6.32 -    if (pfn_batch != NULL)
    6.33 -        free(pfn_batch);
    6.34 -
    6.35 -    if (to_send != NULL)
    6.36 -        free(to_send);
    6.37 -
    6.38 -    if (to_fix != NULL)
    6.39 -        free(to_fix);
    6.40 -
    6.41 -    if (to_skip != NULL)
    6.42 -       free(to_skip);
    6.43 +    free(pfn_type);
    6.44 +    free(pfn_batch);
    6.45 +    free(to_send);
    6.46 +    free(to_fix);
    6.47 +    free(to_skip);
    6.48  
    6.49      DPRINTF("Save exit rc=%d\n",rc);
    6.50      return !!rc;
     7.1 --- a/tools/libxc/xc_load_elf.c	Fri Aug 12 13:06:23 2005 +0000
     7.2 +++ b/tools/libxc/xc_load_elf.c	Fri Aug 12 13:29:57 2005 +0000
     7.3 @@ -309,8 +309,7 @@ loadelfsymtab(
     7.4      dsi->v_end = round_pgup(maxva);
     7.5  
     7.6   out:
     7.7 -    if ( p != NULL )
     7.8 -        free(p);
     7.9 +    free(p);
    7.10  
    7.11      return 0;
    7.12  }
     8.1 --- a/tools/libxc/xc_ptrace.c	Fri Aug 12 13:06:23 2005 +0000
     8.2 +++ b/tools/libxc/xc_ptrace.c	Fri Aug 12 13:29:57 2005 +0000
     8.3 @@ -221,7 +221,7 @@ map_domain_va(unsigned long domid, int c
     8.4      return (void *)(((unsigned long)page_virt[cpu]) | (va & BSD_PAGE_MASK));
     8.5  
     8.6   error_out:
     8.7 -    return 0;
     8.8 +    return NULL;
     8.9  }
    8.10  
    8.11  int 
     9.1 --- a/tools/libxc/xc_vmx_build.c	Fri Aug 12 13:06:23 2005 +0000
     9.2 +++ b/tools/libxc/xc_vmx_build.c	Fri Aug 12 13:29:57 2005 +0000
     9.3 @@ -616,17 +616,15 @@ static int setup_guest(int xc_handle,
     9.4      return 0;
     9.5  
     9.6   error_out:
     9.7 -    if ( mmu != NULL )
     9.8 -        free(mmu);
     9.9 -    if ( page_array != NULL )
    9.10 -        free(page_array);
    9.11 +    free(mmu);
    9.12 +    free(page_array);
    9.13      return -1;
    9.14  }
    9.15  
    9.16  
    9.17  #define VMX_FEATURE_FLAG 0x20
    9.18  
    9.19 -int vmx_identify(void)
    9.20 +static int vmx_identify(void)
    9.21  {
    9.22      int eax, ecx;
    9.23  
    9.24 @@ -745,8 +743,7 @@ int xc_vmx_build(int xc_handle,
    9.25          close(initrd_fd);
    9.26      if ( initrd_gfd )
    9.27          gzclose(initrd_gfd);
    9.28 -    if ( image != NULL )
    9.29 -        free(image);
    9.30 +    free(image);
    9.31  
    9.32      ctxt->flags = VGCF_VMX_GUEST;
    9.33      /* FPU is set up to default initial state. */
    9.34 @@ -801,8 +798,7 @@ int xc_vmx_build(int xc_handle,
    9.35          gzclose(initrd_gfd);
    9.36      else if ( initrd_fd >= 0 )
    9.37          close(initrd_fd);
    9.38 -    if ( image != NULL )
    9.39 -        free(image);
    9.40 +    free(image);
    9.41  
    9.42      return -1;
    9.43  }