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] Disallow setting maxmem to higher value than total p

To: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Disallow setting maxmem to higher value than total physical memory size
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Wed, 01 Sep 2010 14:31:46 +0200
Delivery-date: Wed, 01 Sep 2010 05:31:39 -0700
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: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4
Hi,
this is the patch to disallow changing the maxmem value to higher value than total physical memory size since without this patch I was able to set dom0 maxmem to higher (invalid) value which is not correct. The check for total memory size using the xc.physinfo()['total_mem'] has been implemented in this patch and also the check for negative or zero value in setMemoryMaximum() has been added. When user enters an invalid value (no matter whether negative/zero or higher than total physical memory size) an error is returned saying that the memory size is invalid since no domain (no matter whether dom0 or domU) can have memory higher than maxmem and this prevents maxmem value to be higher than total physical memory installed on dom0. Also, on dom0/domU start the domain maxmem is being checked against whether it doesn't exceed the total physical memory configuration and if it does the value is being reduced the the physical memory size to disallow possibility to set to some higher value.

You can check the patch by `xm list -l | grep maxmem` command which now returns the dom0 physical size on dom0 boot up and when you try to set maximum memory of both dom0 and domU you can't set this to higher value than dom0 total physical memory size. Since there's a sanity check on setting up new memory on domain you'll get "Error: memory_dynamic_max must be less than or equal to memory_static_max" when trying to set to higher value than domain's maxmem.

Michal

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>

--
Michal Novotny<minovotn@xxxxxxxxxx>, RHCE
Virtualization Team (xen userspace), Red Hat

Attachment: xen-disallow-setting-max-mem-higher-than-total-phys-mem.patch
Description: Text Data

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