mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
bitkeeper revision 1.1159.1.87 (412495f853g9qdFCK3fe-wp3blfTlA)
Trap error in cpu value from config.
This commit is contained in:
1 parent
951f7019b3
commit
bf25235281
1 file changed
+6
-2
@@ -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))
|
||||
|
||||