ia64/xen-unstable
changeset 13237:7cd6c032689e
Don't lose the image settings when rebooting domains. This fixes recent HVM
reboot problems -- we were passing 0 to shadow_mem_control, because Xend was
treating the domain as PV.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
reboot problems -- we were passing 0 to shadow_mem_control, because Xend was
treating the domain as PV.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
author | Ewan Mellor <ewan@xensource.com> |
---|---|
date | Tue Jan 02 13:04:01 2007 +0000 (2007-01-02) |
parents | 711c31232d71 |
children | abcd545e7f4c |
files | tools/python/xen/xend/XendConfig.py |
line diff
1.1 --- a/tools/python/xen/xend/XendConfig.py Tue Jan 02 10:57:50 2007 +0000 1.2 +++ b/tools/python/xen/xend/XendConfig.py Tue Jan 02 13:04:01 2007 +0000 1.3 @@ -299,7 +299,7 @@ class XendConfig(dict): 1.4 self._sxp_to_xapi_unsupported(sxp_obj) 1.5 elif xapi: 1.6 self.update_with_xenapi_config(xapi) 1.7 - self._add_xapi_unsupported() 1.8 + self._add_xapi_unsupported(xapi) 1.9 elif dominfo: 1.10 # output from xc.domain_getinfo 1.11 self._dominfo_to_xapi(dominfo) 1.12 @@ -728,19 +728,22 @@ class XendConfig(dict): 1.13 _set_cfg_if_exists('up_time') 1.14 _set_cfg_if_exists('status') # TODO, deprecated 1.15 1.16 - def _add_xapi_unsupported(self): 1.17 + def _add_xapi_unsupported(self, xapi_dict): 1.18 """Updates the configuration object with entries that are not 1.19 officially supported by the Xen API but is required for 1.20 the rest of Xend to function. 1.21 """ 1.22 1.23 # populate image 1.24 - hvm = self['HVM_boot'] != '' 1.25 - self['image']['type'] = hvm and 'hvm' or 'linux' 1.26 - if hvm: 1.27 - self['image']['hvm'] = {} 1.28 - for xapi, cfgapi in XENAPI_HVM_CFG.items(): 1.29 - self['image']['hvm'][cfgapi] = self[xapi] 1.30 + if 'image' in xapi_dict: 1.31 + self['image'].update(xapi_dict['image']) 1.32 + else: 1.33 + hvm = self['HVM_boot'] != '' 1.34 + self['image']['type'] = hvm and 'hvm' or 'linux' 1.35 + if hvm: 1.36 + self['image']['hvm'] = {} 1.37 + for xapi, cfgapi in XENAPI_HVM_CFG.items(): 1.38 + self['image']['hvm'][cfgapi] = self[xapi] 1.39 1.40 1.41 def _get_old_state_string(self):