From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhigang Wang Subject: [PATCH]xl: make mem-set and mem-max to use MB for memory unit by default. Date: Fri, 04 Jun 2010 09:54:46 +0800 Message-ID: <4C085CE6.30106@oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060409040100020709050204" 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: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------060409040100020709050204 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all, As the memory size is huge today and for backward compatibility with xm, I recommend to use MB by default. if use KB, a xl mem-set 0 1024 will invoke oom-killer and make dom0 hang. Thanks, Zhigang --------------060409040100020709050204 Content-Type: text/plain; name="xen-libxl-mem-set-max-default-mb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen-libxl-mem-set-max-default-mb.patch" xl: make mem-set and mem-max to use MB for memory unit by default. Signed-off-by: Zhigang Wang diff -r 4ab68bf4c37e tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Thu Jun 03 07:30:54 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Fri Jun 04 09:44:48 2010 +0800 @@ -1232,9 +1232,9 @@ kbytes <<= 10; case 'g': kbytes <<= 10; + case '\0': case 'm': kbytes <<= 10; - case '\0': case 'k': break; case 'b': @@ -1295,7 +1295,6 @@ exit(1); } - printf("setting domid %d static max memory to : %s\n", domid, mem); exit(0); } @@ -1311,7 +1310,6 @@ exit(3); } - printf("setting domid %d memory to : %lld\n", domid, memorykb); libxl_set_memory_target(&ctx, domid, memorykb, /* enforce */ 1); } diff -r 4ab68bf4c37e tools/libxl/xl_cmdtable.c --- a/tools/libxl/xl_cmdtable.c Thu Jun 03 07:30:54 2010 +0100 +++ b/tools/libxl/xl_cmdtable.c Fri Jun 04 09:44:48 2010 +0800 @@ -121,12 +121,12 @@ { "mem-max", &main_memmax, "Set the maximum amount reservation for a domain", - " ", + " ", }, { "mem-set", &main_memset, "Set the current memory usage for a domain", - " ", + " ", }, { "button-press", &main_button_press, --------------060409040100020709050204 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 --------------060409040100020709050204--