direct-io.hg

changeset 2290:709199bb8055

bitkeeper revision 1.1159.1.87 (412495f853g9qdFCK3fe-wp3blfTlA)

Trap error in cpu value from config.
author mjw@wray-m-3.hpl.hp.com
date Thu Aug 19 11:58:48 2004 +0000 (2004-08-19)
parents 04a0d90a1547
children bf56990784b2
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Aug 19 11:58:11 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Aug 19 11:58:48 2004 +0000
     1.3 @@ -703,10 +703,14 @@ class XendDomainInfo:
     1.4              return
     1.5          memory = self.memory
     1.6          name = self.name
     1.7 -        cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
     1.8 +        try:
     1.9 +            cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
    1.10 +        except:
    1.11 +            raise VmError('invalid cpu')
    1.12          cpu_weight = self.cpu_weight
    1.13          dom = self.dom or 0
    1.14 -        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu, cpu_weight= cpu_weight)
    1.15 +        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024,
    1.16 +                               name= name, cpu= cpu, cpu_weight= cpu_weight)
    1.17          if dom <= 0:
    1.18              raise VmError('Creating domain failed: name=%s memory=%d'
    1.19                            % (name, memory))