debuggers.hg

changeset 22469:b609b1b983d6

libxl, xl: Account for shadow memory for PV guests too

We need to account for the memory needed by shadow pagetables even for PV
guests, because in that case shadow pagetables are used during live
migration.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date Tue Nov 23 19:25:00 2010 +0000 (2010-11-23)
parents 9ffd785319e0
children e908bfa58cd4
files tools/libxl/libxl.c tools/libxl/xl_cmdimpl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Tue Nov 23 19:23:22 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Tue Nov 23 19:25:00 2010 +0000
     1.3 @@ -3026,7 +3026,7 @@ int libxl_domain_need_memory(libxl_ctx *
     1.4          if (strstr(dm_info->device_model, "stubdom-dm"))
     1.5              *need_memkb += 32 * 1024;
     1.6      } else
     1.7 -        *need_memkb += LIBXL_PV_EXTRA_MEMORY;
     1.8 +        *need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
     1.9      if (*need_memkb % (2 * 1024))
    1.10          *need_memkb += (2 * 1024) - (*need_memkb % (2 * 1024));
    1.11      return 0;
     2.1 --- a/tools/libxl/xl_cmdimpl.c	Tue Nov 23 19:23:22 2010 +0000
     2.2 +++ b/tools/libxl/xl_cmdimpl.c	Tue Nov 23 19:25:00 2010 +0000
     2.3 @@ -332,8 +332,8 @@ static void init_build_info(libxl_domain
     2.4      b_info->target_memkb = b_info->max_memkb;
     2.5      b_info->disable_migrate = 0;
     2.6      b_info->cpuid = NULL;
     2.7 +    b_info->shadow_memkb = 0;
     2.8      if (c_info->hvm) {
     2.9 -        b_info->shadow_memkb = 0; /* Set later */
    2.10          b_info->video_memkb = 8 * 1024;
    2.11          b_info->kernel.path = strdup("hvmloader");
    2.12          b_info->hvm = 1;