direct-io.hg

changeset 12758:e8a74ac80167

[XEND] Update vcpu_avail when parsing configuration.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Dec 07 11:12:05 2006 +0000 (2006-12-07)
parents 3f0ca90351e2
children 0f5dd1d43b67 f7cff5d296bf
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Dec 07 10:54:43 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Thu Dec 07 11:12:05 2006 +0000
     1.3 @@ -353,10 +353,15 @@ class XendConfig(dict):
     1.4          if self['builder'] not in ('hvm', 'linux'):
     1.5              raise XendConfigError('Invalid builder configuration')
     1.6  
     1.7 +    def _vcpus_sanity_check(self):
     1.8 +        if self.get('vcpus_number') != None:
     1.9 +            self['vcpu_avail'] = (1 << self['vcpus_number']) - 1
    1.10 +
    1.11      def validate(self):
    1.12          self._memory_sanity_check()
    1.13          self._actions_sanity_check()
    1.14          self._builder_sanity_check()
    1.15 +        self._vcpus_sanity_check()
    1.16  
    1.17      def _dominfo_to_xapi(self, dominfo):
    1.18          self['domid'] = dominfo['domid']