direct-io.hg

changeset 12237:b5c50a603044

[XEND] XendDomainInfo.refreshShutdown is called from image.py.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Nov 03 15:17:00 2006 +0000 (2006-11-03)
parents e5067f9b268f
children 3a0116aa7ff5
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 03 15:15:16 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Nov 03 15:17:00 2006 +0000
     1.3 @@ -228,7 +228,7 @@ def recreate(info, priv):
     1.4          vm._storeDomDetails()
     1.5          
     1.6      vm._registerWatches()
     1.7 -    vm._refreshShutdown(xeninfo)
     1.8 +    vm.refreshShutdown(xeninfo)
     1.9      return vm
    1.10  
    1.11  
    1.12 @@ -437,7 +437,7 @@ class XendDomainInfo:
    1.13                  self._storeVmDetails()
    1.14                  self._storeDomDetails()
    1.15                  self._registerWatches()
    1.16 -                self._refreshShutdown()
    1.17 +                self.refreshShutdown()
    1.18                  self.unpause()
    1.19  
    1.20                  # save running configuration if XendDomains believe domain is
    1.21 @@ -773,7 +773,7 @@ class XendDomainInfo:
    1.22              log.trace(
    1.23                  "Scheduling refreshShutdown on domain %d in %ds.",
    1.24                  self.domid, timeout)
    1.25 -            threading.Timer(timeout, self._refreshShutdown).start()
    1.26 +            threading.Timer(timeout, self.refreshShutdown).start()
    1.27              
    1.28          return True
    1.29  
    1.30 @@ -841,8 +841,11 @@ class XendDomainInfo:
    1.31      def getRestartCount(self):
    1.32          return self._readVm('xend/restart_count')
    1.33  
    1.34 -    def _refreshShutdown(self, xeninfo = None):
    1.35 -        """ Checks the domain for whether a shutdown is required. """
    1.36 +    def refreshShutdown(self, xeninfo = None):
    1.37 +        """ Checks the domain for whether a shutdown is required.
    1.38 +
    1.39 +        Called from XendDomainInfo and also image.py for HVM images.
    1.40 +        """
    1.41          
    1.42          # If set at the end of this method, a restart is required, with the
    1.43          # given reason.  This restart has to be done out of the scope of
    1.44 @@ -1387,7 +1390,7 @@ class XendDomainInfo:
    1.45          self._introduceDomain()
    1.46          self._storeDomDetails()
    1.47          self._registerWatches()
    1.48 -        self._refreshShutdown()
    1.49 +        self.refreshShutdown()
    1.50  
    1.51          log.debug("XendDomainInfo.completeRestore done")
    1.52  
    1.53 @@ -1650,7 +1653,7 @@ class XendDomainInfo:
    1.54          self.info.validate()
    1.55  
    1.56          if refresh:
    1.57 -            self._refreshShutdown(info)
    1.58 +            self.refreshShutdown(info)
    1.59  
    1.60          log.trace("XendDomainInfo.update done on domain %s: %s",
    1.61                    str(self.domid), self.info)