[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [LIBXC] Fix memory alloc/dealloc routines to return error properly.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Node ID 5a41ea282c86bfb3603bdd5feb9199ac8f80e86d # Parent e796d9c2f5e8e06939a2ba8fcdbd4c024361571d [LIBXC] Fix memory alloc/dealloc routines to return error properly. Remove unnecessary decrease_reservation() from hvm builder. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- tools/libxc/xc_domain.c | 8 ++++---- tools/libxc/xc_hvm_build.c | 9 --------- 2 files changed, 4 insertions(+), 13 deletions(-) diff -r e796d9c2f5e8 -r 5a41ea282c86 tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Tue Nov 07 11:19:26 2006 +0000 +++ b/tools/libxc/xc_domain.c Tue Nov 07 11:54:52 2006 +0000 @@ -349,7 +349,7 @@ int xc_domain_memory_increase_reservatio 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_reservatio 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(in 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 -r e796d9c2f5e8 -r 5a41ea282c86 tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Tue Nov 07 11:19:26 2006 +0000 +++ b/tools/libxc/xc_hvm_build.c Tue Nov 07 11:54:52 2006 +0000 @@ -219,15 +219,6 @@ static int setup_guest(int xc_handle, if ( rc != 0 ) { PERROR("Could not allocate memory for HVM guest.\n"); - 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; } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |