ia64/xen-unstable

changeset 14537:6f2f72f39872

Fix rebooting domains problem with new internal memory storage

signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
author Tom Wilkie <tom.wilkie@gmail.com>
date Fri Mar 23 15:10:46 2007 +0000 (2007-03-23)
parents 678b8838d361
children 2249cb6b5e42
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Fri Mar 23 13:27:29 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Fri Mar 23 15:10:46 2007 +0000
     1.3 @@ -269,7 +269,7 @@ class XendConfig(dict):
     1.4              self.update_with_xenapi_config(xapi)
     1.5          elif dominfo:
     1.6              # output from xc.domain_getinfo
     1.7 -            self._dominfo_to_xapi(dominfo)
     1.8 +            self._dominfo_to_xapi(dominfo, update_mem = True)
     1.9  
    1.10          log.debug('XendConfig.init: %s' % scrub_password(self))
    1.11  
    1.12 @@ -405,15 +405,17 @@ class XendConfig(dict):
    1.13          self._vcpus_sanity_check()
    1.14          self._platform_sanity_check()
    1.15  
    1.16 -    def _dominfo_to_xapi(self, dominfo):
    1.17 +    def _dominfo_to_xapi(self, dominfo, update_mem = False):
    1.18          self['domid'] = dominfo['domid']
    1.19          self['online_vcpus'] = dominfo['online_vcpus']
    1.20          self['VCPUs_max'] = dominfo['max_vcpu_id'] + 1
    1.21  
    1.22 -        self['memory_dynamic_min'] = dominfo['mem_kb'] * 1024
    1.23 -        self['memory_dynamic_max'] = dominfo['mem_kb'] * 1024
    1.24 -        self['memory_static_min'] = 0
    1.25 -        self['memory_static_max'] = dominfo['maxmem_kb'] * 1024
    1.26 +        if update_mem:
    1.27 +            self['memory_dynamic_min'] = dominfo['mem_kb'] * 1024
    1.28 +            self['memory_dynamic_max'] = dominfo['mem_kb'] * 1024
    1.29 +            self['memory_static_min'] = 0
    1.30 +            self['memory_static_max'] = dominfo['maxmem_kb'] * 1024
    1.31 +            self._memory_sanity_check()
    1.32  
    1.33          self['cpu_time'] = dominfo['cpu_time']/1e9
    1.34          # TODO: i don't know what the security stuff expects here