From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] domain builder: Fix sp_extents allocation Date: Thu, 31 Jul 2008 12:12:50 +0100 Message-ID: <20080731111250.GE4678@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org domain builder: Fix sp_extents allocation We do not need more than count elements in the sp_extents array. diff -r e355f9dce939 tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Wed Jul 30 17:20:25 2008 +0100 +++ b/tools/libxc/xc_hvm_build.c Thu Jul 31 11:43:36 2008 +0100 @@ -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,