# HG changeset patch # User mjw@wray-m-3.hpl.hp.com # Date 1092916728 0 # Node ID 709199bb805504d3a51d1513c0c8e8946c7f2a91 # Parent 04a0d90a1547b3b8603496b7fa5e5b986748ac57 bitkeeper revision 1.1159.1.87 (412495f853g9qdFCK3fe-wp3blfTlA) Trap error in cpu value from config. diff -r 04a0d90a1547 -r 709199bb8055 tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Thu Aug 19 11:58:11 2004 +0000 +++ b/tools/python/xen/xend/XendDomainInfo.py Thu Aug 19 11:58:48 2004 +0000 @@ -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))