diff options
author | mjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com> | 2004-08-19 11:58:48 +0000 |
---|---|---|
committer | mjw@wray-m-3.hpl.hp.com <mjw@wray-m-3.hpl.hp.com> | 2004-08-19 11:58:48 +0000 |
commit | bf25235281329df309f8b9221cdf1dbc9836d2d2 (patch) | |
tree | e276f95faec45d869ec39cfc629614908528a436 | |
parent | 951f7019b304442519c93e1837a45c17db49899d (diff) | |
download | xen-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.py | 8 |
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)) |