From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu Zhiguo Subject: Re: [PATCH] xl: Update memory info in xenstore when use 'xl mem-set' Date: Sun, 09 May 2010 16:45:20 +0800 Message-ID: <4BE67620.7010803@cn.fujitsu.com> References: <4BE3DFBE.2010901@cn.fujitsu.com> <19428.20752.717993.453216@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19428.20752.717993.453216@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Hi Ian, Ian Jackson wrote: > > However, looking at this, it's far from clear why > libxl_set_memory_target calls xc_domain_setmaxmem at all. Can anyone > explain ? I'm trying to add subcommand 'mem-max', I think xc_domain_setmaxmem should be used in it but not here. I'll move this code to 'mem-max', and in 'mem-set', a check should be added because setting memory larger than max memory is invalid. 1. Add 'mem-max' Add libxl_domain_setmaxmem, it calls xc_domain_setmaxmem. /local/domain/$domid/memory/static-max should be updated when set max memory, it is missing now. 2. fix 'mem-set' Delete xc_domain_setmaxmem. Get max memory from /local/domain/$domid/memory/static-max, and then do value check. It seems that we cannot get max memory use libxc routines. Do you agree with me? Add, I found another problem about mem-set. I used 'xl mem-set' set the memory, but the size displayed in output of 'xm list' did not change. It seems that 'xm' get the memory size from xend, xend maintains some info of VM. I'm not sure how to resolve this problem? Get info from xenstore? What's your opinion? # xl mem-set 3 204800 setting domid 3 memory to : 204800 # xl list Name ID Mem VCPUs State Time(s) ... pvguest1 3 200 2 r-- 0.2 # xm list Name ID Mem VCPUs State Time(s) ... pvguest1 3 256 2 -b---- 0.2 Regards Yu Zhiguo