From: kfraser@localhost.localdomain Date: Tue, 7 Nov 2006 11:54:52 +0000 (+0000) Subject: [LIBXC] Fix memory alloc/dealloc routines to return error properly. X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=428e6e49005cf7dac8784006c40bfd9f32982ed2;p=xen.git [LIBXC] Fix memory alloc/dealloc routines to return error properly. Remove unnecessary decrease_reservation() from hvm builder. Signed-off-by: Keir Fraser --- diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index a1cafb7207..7936d00dc9 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -349,7 +349,7 @@ int xc_domain_memory_increase_reservation(int xc_handle, if ( err == nr_extents ) return 0; - if ( err > 0 ) + if ( err >= 0 ) { DPRINTF("Failed allocation for dom %d: " "%ld pages order %d addr_bits %d\n", @@ -388,11 +388,11 @@ int xc_domain_memory_decrease_reservation(int xc_handle, if ( err == nr_extents ) return 0; - if ( err > 0 ) + if ( err >= 0 ) { DPRINTF("Failed deallocation for dom %d: %ld pages order %d\n", domid, nr_extents, extent_order); - errno = EBUSY; + errno = EINVAL; err = -1; } @@ -419,7 +419,7 @@ int xc_domain_memory_populate_physmap(int xc_handle, if ( err == nr_extents ) return 0; - if ( err > 0 ) + if ( err >= 0 ) { DPRINTF("Failed allocation for dom %d: %ld pages order %d\n", domid, nr_extents, extent_order); diff --git a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c index a030cccd52..3bc4a01ce9 100644 --- a/tools/libxc/xc_hvm_build.c +++ b/tools/libxc/xc_hvm_build.c @@ -222,15 +222,6 @@ static int setup_guest(int xc_handle, goto error_out; } - if ( (nr_pages > 0xa0) && - xc_domain_memory_decrease_reservation( - xc_handle, dom, (nr_pages < 0xc0) ? (nr_pages - 0xa0) : 0x20, - 0, &page_array[0xa0]) ) - { - PERROR("Could not free VGA hole.\n"); - goto error_out; - } - if ( xc_domain_translate_gpfn_list(xc_handle, dom, nr_pages, page_array, page_array) ) {