direct-io.hg

changeset 12215:96ad1d72fccf

[XEND] Fix paused state being overriden by refreshShutdown

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Nov 02 15:48:32 2006 +0000 (2006-11-02)
parents 722cc2390021
children ec7e7e946496
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Thu Nov 02 14:27:16 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Thu Nov 02 15:48:32 2006 +0000
     1.3 @@ -608,8 +608,6 @@ class XendConfig(dict):
     1.4      def get_sxp(self, domain = None, ignore_devices = False, ignore = []):
     1.5          """ Get SXP representation of this config object.
     1.6  
     1.7 -        Incompat: removed store_mfn, console_mfn
     1.8 -
     1.9          @keyword domain: (optional) XendDomainInfo to get extra information
    1.10                           from such as domid and running devices.
    1.11          @type    domain: XendDomainInfo
    1.12 @@ -647,13 +645,10 @@ class XendConfig(dict):
    1.13              sxpr.append(['up_time', str(uptime)])
    1.14              sxpr.append(['start_time', str(self['start_time'])])
    1.15  
    1.16 -        sxpr.append(['on_xend_start', self.get('on_xend_start', 'ignore')])
    1.17 -        sxpr.append(['on_xend_stop', self.get('on_xend_stop', 'ignore')])
    1.18 -
    1.19          if domain:
    1.20 -            sxpr.append(['status', domain.state])
    1.21 +            sxpr.append(['status', str(domain.state)])
    1.22          else:
    1.23 -            sxpr.append(['status', DOM_STATE_HALTED])
    1.24 +            sxpr.append(['status', str(DOM_STATE_HALTED)])
    1.25  
    1.26          # For save/restore migration
    1.27          if domain:
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 02 14:27:16 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 02 15:48:32 2006 +0000
     2.3 @@ -843,6 +843,8 @@ class XendDomainInfo:
     2.4          return self._readVm('xend/restart_count')
     2.5  
     2.6      def _refreshShutdown(self, xeninfo = None):
     2.7 +        """ Checks the domain for whether a shutdown is required. """
     2.8 +        
     2.9          # If set at the end of this method, a restart is required, with the
    2.10          # given reason.  This restart has to be done out of the scope of
    2.11          # refresh_shutdown_lock.
    2.12 @@ -926,8 +928,11 @@ class XendDomainInfo:
    2.13              else:
    2.14                  # Domain is alive.  If we are shutting it down, then check
    2.15                  # the timeout on that, and destroy it if necessary.
    2.16 -                self._stateSet(DOM_STATE_RUNNING)
    2.17 -                
    2.18 +                if xeninfo['paused']:
    2.19 +                    self._stateSet(DOM_STATE_PAUSED)
    2.20 +                else:
    2.21 +                    self._stateSet(DOM_STATE_RUNNING)
    2.22 +                    
    2.23                  if self.shutdownStartTime:
    2.24                      timeout = (SHUTDOWN_TIMEOUT - time.time() +
    2.25                                 self.shutdownStartTime)