bitkeeper revision 1.1159.1.87 (412495f853g9qdFCK3fe-wp3blfTlA)

Trap error in cpu value from config.
This commit is contained in:
mjw@wray-m-3.hpl.hp.com committed 2004-08-19 11:58:48 +00:00
1 parent 951f7019b3
commit bf25235281
1 file changed
+6 -2
+6 -2
View File
@@ -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))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.