[LIBXC] Fix memory alloc/dealloc routines to return error properly.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 7 Nov 2006 11:54:52 +0000 (11:54 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Tue, 7 Nov 2006 11:54:52 +0000 (11:54 +0000)
Remove unnecessary decrease_reservation() from hvm builder.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xc_domain.c
tools/libxc/xc_hvm_build.c

index a1cafb720770a65bc9bb3e713d3ba20cf909ff6a..7936d00dc9f7a58ef68a9df182dd692cfc3d7661 100644 (file)
@@ -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);
index a030cccd52b55dc2751cecb30ce48172031e4266..3bc4a01ce9cb5392d0e6f60864fb14c20fad538a 100644 (file)
@@ -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) )
     {