From 259e50f5931342885c2c47460d8c57f7e732f798 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 25 Apr 2007 22:22:31 +0100 Subject: xen: Fix maximum_gpfn() hypercall to always return max_gpfn not nr_gpfns. Fix callers to convert this to nr_gpfns (aka p2m_size) if that's what they actually need. Signed-off-by: Keir Fraser --- tools/libxc/xc_core_x86.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/libxc/xc_core_x86.c') diff --git a/tools/libxc/xc_core_x86.c b/tools/libxc/xc_core_x86.c index 0f2a19c451..b3d5d26fbf 100644 --- a/tools/libxc/xc_core_x86.c +++ b/tools/libxc/xc_core_x86.c @@ -21,9 +21,9 @@ #include "xg_private.h" #include "xc_core.h" -static int max_gpfn(int xc_handle, domid_t domid) +static int nr_gpfns(int xc_handle, domid_t domid) { - return xc_memory_op(xc_handle, XENMEM_maximum_gpfn, &domid); + return xc_memory_op(xc_handle, XENMEM_maximum_gpfn, &domid) + 1; } int @@ -38,7 +38,7 @@ xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info, xc_core_memory_map_t **mapp, unsigned int *nr_entries) { - unsigned long p2m_size = max_gpfn(xc_handle, info->domid); + unsigned long p2m_size = nr_gpfns(xc_handle, info->domid); xc_core_memory_map_t *map; map = malloc(sizeof(*map)); @@ -65,7 +65,7 @@ xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info, xen_pfn_t *live_p2m_frame_list_list = NULL; xen_pfn_t *live_p2m_frame_list = NULL; uint32_t dom = info->domid; - unsigned long p2m_size = max_gpfn(xc_handle, info->domid); + unsigned long p2m_size = nr_gpfns(xc_handle, info->domid); int ret = -1; int err; -- cgit v1.2.3