[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [XEND] Update vcpu_avail when parsing configuration.



# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID e8a74ac8016756a303cb889abbb95e593484fb5d
# Parent  3f0ca90351e268084fbdb733d70fc596cb46537d
[XEND] Update vcpu_avail when parsing configuration.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py |    5 +++++
 1 files changed, 5 insertions(+)

diff -r 3f0ca90351e2 -r e8a74ac80167 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Dec 07 10:54:43 2006 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Thu Dec 07 11:12:05 2006 +0000
@@ -353,10 +353,15 @@ class XendConfig(dict):
         if self['builder'] not in ('hvm', 'linux'):
             raise XendConfigError('Invalid builder configuration')
 
+    def _vcpus_sanity_check(self):
+        if self.get('vcpus_number') != None:
+            self['vcpu_avail'] = (1 << self['vcpus_number']) - 1
+
     def validate(self):
         self._memory_sanity_check()
         self._actions_sanity_check()
         self._builder_sanity_check()
+        self._vcpus_sanity_check()
 
     def _dominfo_to_xapi(self, dominfo):
         self['domid'] = dominfo['domid']

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.