From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: [PATCH] Check for valid CPU_CAP value when creating (constructing) new domain Date: Mon, 30 Mar 2009 08:43:07 +0200 Message-ID: <49D069FB.1020401@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030206080607090703090107" 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@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------030206080607090703090107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------030206080607090703090107 Content-Type: text/plain; name="xen-valid-cap-value-when-creating-domain.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-valid-cap-value-when-creating-domain.patch" 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 = '' --------------030206080607090703090107 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 --------------030206080607090703090107--