aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-08-19 11:58:48 +0000
committermjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com>2004-08-19 11:58:48 +0000
commitbf25235281329df309f8b9221cdf1dbc9836d2d2 (patch)
treee276f95faec45d869ec39cfc629614908528a436
parent951f7019b304442519c93e1837a45c17db49899d (diff)
downloadxen-bf25235281329df309f8b9221cdf1dbc9836d2d2.tar.gz
xen-bf25235281329df309f8b9221cdf1dbc9836d2d2.tar.bz2
xen-bf25235281329df309f8b9221cdf1dbc9836d2d2.zip
bitkeeper revision 1.1159.1.87 (412495f853g9qdFCK3fe-wp3blfTlA)
Trap error in cpu value from config.
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 63dc7f49ab..f8345f58b4 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -703,10 +703,14 @@ class XendDomainInfo:
return
memory = self.memory
name = self.name
- cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
+ try:
+ cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
+ except:
+ raise VmError('invalid cpu')
cpu_weight = self.cpu_weight
dom = self.dom or 0
- dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu, cpu_weight= cpu_weight)
+ dom = xc.domain_create(dom= dom, mem_kb= memory * 1024,
+ name= name, cpu= cpu, cpu_weight= cpu_weight)
if dom <= 0:
raise VmError('Creating domain failed: name=%s memory=%d'
% (name, memory))