ia64/xen-unstable

changeset 12287:5a41ea282c86

[LIBXC] Fix memory alloc/dealloc routines to return error properly.
Remove unnecessary decrease_reservation() from hvm builder.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Nov 07 11:54:52 2006 +0000 (2006-11-07)
parents e796d9c2f5e8
children 6f551093f068
files tools/libxc/xc_domain.c tools/libxc/xc_hvm_build.c
line diff
     1.1 --- a/tools/libxc/xc_domain.c	Tue Nov 07 11:19:26 2006 +0000
     1.2 +++ b/tools/libxc/xc_domain.c	Tue Nov 07 11:54:52 2006 +0000
     1.3 @@ -349,7 +349,7 @@ int xc_domain_memory_increase_reservatio
     1.4      if ( err == nr_extents )
     1.5          return 0;
     1.6  
     1.7 -    if ( err > 0 )
     1.8 +    if ( err >= 0 )
     1.9      {
    1.10          DPRINTF("Failed allocation for dom %d: "
    1.11                  "%ld pages order %d addr_bits %d\n",
    1.12 @@ -388,11 +388,11 @@ int xc_domain_memory_decrease_reservatio
    1.13      if ( err == nr_extents )
    1.14          return 0;
    1.15  
    1.16 -    if ( err > 0 )
    1.17 +    if ( err >= 0 )
    1.18      {
    1.19          DPRINTF("Failed deallocation for dom %d: %ld pages order %d\n",
    1.20                  domid, nr_extents, extent_order);
    1.21 -        errno = EBUSY;
    1.22 +        errno = EINVAL;
    1.23          err = -1;
    1.24      }
    1.25  
    1.26 @@ -419,7 +419,7 @@ int xc_domain_memory_populate_physmap(in
    1.27      if ( err == nr_extents )
    1.28          return 0;
    1.29  
    1.30 -    if ( err > 0 )
    1.31 +    if ( err >= 0 )
    1.32      {
    1.33          DPRINTF("Failed allocation for dom %d: %ld pages order %d\n",
    1.34                  domid, nr_extents, extent_order);
     2.1 --- a/tools/libxc/xc_hvm_build.c	Tue Nov 07 11:19:26 2006 +0000
     2.2 +++ b/tools/libxc/xc_hvm_build.c	Tue Nov 07 11:54:52 2006 +0000
     2.3 @@ -222,15 +222,6 @@ static int setup_guest(int xc_handle,
     2.4          goto error_out;
     2.5      }
     2.6  
     2.7 -    if ( (nr_pages > 0xa0) &&
     2.8 -         xc_domain_memory_decrease_reservation(
     2.9 -             xc_handle, dom, (nr_pages < 0xc0) ? (nr_pages - 0xa0) : 0x20,
    2.10 -             0, &page_array[0xa0]) )
    2.11 -    {
    2.12 -        PERROR("Could not free VGA hole.\n");
    2.13 -        goto error_out;
    2.14 -    }
    2.15 -
    2.16      if ( xc_domain_translate_gpfn_list(xc_handle, dom, nr_pages,
    2.17                                         page_array, page_array) )
    2.18      {