mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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>
This commit is contained in:
1 parent
d51d277c9b
commit
46d89e453b
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -3026,7 +3026,7 @@ int libxl_domain_need_memory(libxl_ctx *ctx, libxl_domain_build_info *b_info,
|
||||
if (strstr(dm_info->device_model, "stubdom-dm"))
|
||||
*need_memkb += 32 * 1024;
|
||||
} else
|
||||
*need_memkb += LIBXL_PV_EXTRA_MEMORY;
|
||||
*need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
|
||||
if (*need_memkb % (2 * 1024))
|
||||
*need_memkb += (2 * 1024) - (*need_memkb % (2 * 1024));
|
||||
return 0;
|
||||
|
||||
@@ -332,8 +332,8 @@ static void init_build_info(libxl_domain_build_info *b_info, libxl_domain_create
|
||||
b_info->target_memkb = b_info->max_memkb;
|
||||
b_info->disable_migrate = 0;
|
||||
b_info->cpuid = NULL;
|
||||
b_info->shadow_memkb = 0;
|
||||
if (c_info->hvm) {
|
||||
b_info->shadow_memkb = 0; /* Set later */
|
||||
b_info->video_memkb = 8 * 1024;
|
||||
b_info->kernel.path = strdup("hvmloader");
|
||||
b_info->hvm = 1;
|
||||
|
||||