From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH] xl: fix ballooning Date: Wed, 27 Oct 2010 15:46:18 +0200 Message-ID: <4CC82D2A.10704@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020505030000030907080201" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Stefano Stabellini Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --------------020505030000030907080201 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi, we should only check the value of new_target_memkb _after_ it has been properly setup. This fixes ballooning Dom0, which was broken since 22200:49a3c1721734. Signed-off-by: Andre Przywara -- Andre Przywara AMD-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 448-3567-12 --------------020505030000030907080201 Content-Type: text/x-patch; name="fix_xl_ballooning.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_xl_ballooning.patch" diff -r cd193fa265b8 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Tue Oct 26 12:22:52 2010 +0100 +++ b/tools/libxl/libxl.c Wed Oct 27 13:47:05 2010 +0200 @@ -2927,6 +2927,11 @@ abort = 1; goto out; } + if (relative) + new_target_memkb = current_target_memkb + target_memkb; + else + new_target_memkb = target_memkb; + if (!domid && new_target_memkb < LIBXL_MIN_DOM0_MEM) { LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "new target for dom0 is below the minimum threshold\n"); @@ -2934,10 +2939,6 @@ goto out; } - if (relative) - new_target_memkb = current_target_memkb + target_memkb; - else - new_target_memkb = target_memkb; if (new_target_memkb > memorykb) { LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "memory_dynamic_max must be less than or equal to" --------------020505030000030907080201 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020505030000030907080201--