hvm builder: Cleaner sp_extents allocation
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 31 Jul 2008 11:38:32 +0000 (12:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 31 Jul 2008 11:38:32 +0000 (12:38 +0100)
We do not need more than count elements in the sp_extents array.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/libxc/xc_hvm_build.c

index a174b430a119722b768a08ec876a7d74b6aa0e4f..752c4e76dcd2f3f4bdb209d73ce4a9af60dd49a4 100644 (file)
@@ -229,7 +229,7 @@ static int setup_guest(int xc_handle,
         if ( ((count | cur_pages) & (SUPERPAGE_NR_PFNS - 1)) == 0 )
         {
             long done;
-            xen_pfn_t sp_extents[2048 >> SUPERPAGE_PFN_SHIFT];
+            xen_pfn_t sp_extents[count >> SUPERPAGE_PFN_SHIFT];
             struct xen_memory_reservation sp_req = {
                 .nr_extents   = count >> SUPERPAGE_PFN_SHIFT,
                 .extent_order = SUPERPAGE_PFN_SHIFT,