ia64/xen-unstable

changeset 12597:1c09d1d195e7

Don't send the old state string for halted domains -- it doesn't make any
sense, and we don't want to see state flags linger.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Nov 27 14:48:38 2006 +0000 (2006-11-27)
parents ca01484e4e8c
children 445db3980f61
files tools/python/xen/xend/XendConfig.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Mon Nov 27 14:47:23 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Mon Nov 27 14:48:38 2006 +0000
     1.3 @@ -685,15 +685,15 @@ class XendConfig(dict):
     1.4          # TODO: domid/dom is the same thing but called differently
     1.5          #       depending if it is from xenstore or sxpr.
     1.6  
     1.7 -        if domain.getDomid() != None:
     1.8 +        if domain.getDomid() is not None:
     1.9              sxpr.append(['domid', domain.getDomid()])
    1.10  
    1.11          for cfg, typefunc in ROUNDTRIPPING_CONFIG_ENTRIES:
    1.12              if cfg in self:
    1.13 -                if self[cfg] != None:
    1.14 +                if self[cfg] is not None:
    1.15                      sxpr.append([cfg, self[cfg]])
    1.16  
    1.17 -        if 'image' in self and self['image'] != None:
    1.18 +        if 'image' in self and self['image'] is not None:
    1.19              sxpr.append(['image', self['image']])
    1.20          if 'security' in self and self['security']:
    1.21              sxpr.append(['security', self['security']])
    1.22 @@ -714,7 +714,9 @@ class XendConfig(dict):
    1.23          else:
    1.24              sxpr.append(['status', str(DOM_STATE_HALTED)])
    1.25  
    1.26 -        sxpr.append(['state', self._get_old_state_string()])
    1.27 +        if domain.getDomid() is not None:
    1.28 +            sxpr.append(['state', self._get_old_state_string()])
    1.29 +
    1.30          sxpr.append(['memory_dynamic_max', self.get('memory_dynamic_max',
    1.31                                                      self['memory'])])
    1.32