ia64/xen-unstable

changeset 6920:6a48f88101d3

Don't run reap() or domain_restarts() as side-effects of refresh.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Sep 16 20:12:42 2005 +0000 (2005-09-16)
parents edd70af0fb22
children 931526414a64
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Fri Sep 16 20:03:57 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri Sep 16 20:12:42 2005 +0000
     1.3 @@ -96,7 +96,9 @@ class XendDomain:
     1.4          return map(lambda x: x.name, doms)
     1.5  
     1.6      def onReleaseDomain(self):
     1.7 -        self.refresh(cleanup=True)
     1.8 +        self.reap()
     1.9 +        self.refresh()
    1.10 +        self.domain_restarts()
    1.11  
    1.12      def watchReleaseDomain(self):
    1.13          from xen.xend.xenstore.xswatch import xswatch
    1.14 @@ -150,7 +152,9 @@ class XendDomain:
    1.15                      self._delete_domain(domid)
    1.16              else:
    1.17                  self._delete_domain(domid)
    1.18 -        self.refresh(cleanup=True)
    1.19 +        self.reap()
    1.20 +        self.refresh()
    1.21 +        self.domain_restarts()
    1.22  
    1.23      def dom0_setup():
    1.24          dom0 = self.domain_lookup(0)
    1.25 @@ -245,25 +249,18 @@ class XendDomain:
    1.26                      self.domain_restart_schedule(domid, reason)
    1.27              dominfo.destroy()
    1.28  
    1.29 -    def refresh(self, cleanup=False):
    1.30 +    def refresh(self):
    1.31          """Refresh domain list from Xen.
    1.32          """
    1.33 -        if cleanup:
    1.34 -            self.reap()
    1.35          doms = self.xen_domains()
    1.36          # Remove entries for domains that no longer exist.
    1.37          # Update entries for existing domains.
    1.38 -        do_domain_restarts = False
    1.39          for d in self.domains.values():
    1.40              info = doms.get(d.domid)
    1.41              if info:
    1.42                  d.update(info)
    1.43 -            elif d.restart_pending():
    1.44 -                do_domain_restarts = True
    1.45 -            else:
    1.46 +            elif not d.restart_pending():
    1.47                  self._delete_domain(d.domid)
    1.48 -        if cleanup and do_domain_restarts:
    1.49 -            scheduler.now(self.domain_restarts)
    1.50  
    1.51      def update_domain(self, id):
    1.52          """Update information for a single domain.