WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] libxl: accout for shadow memory for PV guests too

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxl: accout for shadow memory for PV guests too
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Thu, 18 Nov 2010 14:58:56 +0000
Delivery-date: Thu, 18 Nov 2010 07:00:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Accout for shadow memory for PV guests too

We need to accout 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@xxxxxxxxxxxxx>

diff -r 7d2fdc083c9c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Thu Nov 18 12:28:31 2010 +0000
+++ b/tools/libxl/libxl.c       Thu Nov 18 14:46:26 2010 +0000
@@ -3023,7 +3023,7 @@ int libxl_domain_need_memory(libxl_ctx *
         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;
diff -r 7d2fdc083c9c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Nov 18 12:28:31 2010 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Thu Nov 18 14:46:26 2010 +0000
@@ -332,8 +332,8 @@ static void init_build_info(libxl_domain
     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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>