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] Check for valid CPU_CAP value when creating (constru

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Check for valid CPU_CAP value when creating (constructing) new domain
From: Michal Novotny <minovotn@xxxxxxxxxx>
Date: Mon, 30 Mar 2009 08:43:07 +0200
Delivery-date: Sun, 29 Mar 2009 23:43:32 -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: Thunderbird 2.0.0.21 (X11/20090320)
Hi,

This patch implements check for valid cpu_cap value when creating domain (in 
range 0 to VcpuCount * 100 as when changing scheduler parameters).

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

diff -r 0b13d9787622 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Mar 24 06:55:29 2009 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Mar 30 08:39:01 2009 +0200
@@ -2305,6 +2305,11 @@
         # Set maximum number of vcpus in domain
         xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
 
+        cap = self.getCap()
+        if cap < 0 or cap > self.info['VCPUs_max'] * 100:
+            raise VmError("Invalid CAP range, valid range is from 0 to %s for 
specified number of vcpus" %
+                         (int(self.info['VCPUs_max']) * 100) )
+
         # Test whether the devices can be assigned with VT-d
         pci = self.info["platform"].get("pci")
         pci_str = ''
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel