direct-io.hg

changeset 12487:516821812322

[XEND] Revert changes in changeset 12328

Mistakenly reverted some fixes for rebooting, un-reverting.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Fri Nov 17 17:03:59 2006 +0000 (2006-11-17)
parents 645ef4726bce
children f1d2860c5137
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Fri Nov 17 15:53:29 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Fri Nov 17 17:03:59 2006 +0000
     1.3 @@ -377,24 +377,12 @@ class XendDomain:
     1.4          @rtype: None
     1.5          """
     1.6  
     1.7 -        # update information for all running domains
     1.8 -        # - like cpu_time, status, dying, etc.
     1.9          running = self._running_domains()
    1.10 -        running_domids = [d['domid'] for d in running if d['dying'] != 1]
    1.11 -
    1.12 -        # remove domains that are not running from active domain list.
    1.13 -        # The list might have changed by now, because the update call may
    1.14 -        # cause new domains to be added, if the domain has rebooted.  We get
    1.15 -        # the list again.        
    1.16 -        for domid, dom in self.domains.items():
    1.17 -            if domid not in running_domids and domid != DOM0_ID:
    1.18 -                self._remove_domain(dom, domid)
    1.19 -
    1.20          # Add domains that are not already tracked but running in Xen,
    1.21          # and update domain state for those that are running and tracked.
    1.22          for dom in running:
    1.23              domid = dom['domid']
    1.24 -            if domid in self.domains and dom['dying'] != 1:
    1.25 +            if domid in self.domains:
    1.26                  self.domains[domid].update(dom)
    1.27              elif domid not in self.domains and dom['dying'] != 1:
    1.28                  try:
    1.29 @@ -408,6 +396,19 @@ class XendDomain:
    1.30                          log.exception("Hard destruction of domain failed: %d" %
    1.31                                        domid)
    1.32  
    1.33 +        # update information for all running domains
    1.34 +        # - like cpu_time, status, dying, etc.
    1.35 +        # remove domains that are not running from active domain list.
    1.36 +        # The list might have changed by now, because the update call may
    1.37 +        # cause new domains to be added, if the domain has rebooted.  We get
    1.38 +        # the list again.
    1.39 +        running = self._running_domains()
    1.40 +        running_domids = [d['domid'] for d in running if d['dying'] != 1]
    1.41 +        for domid, dom in self.domains.items():
    1.42 +            if domid not in running_domids and domid != DOM0_ID:
    1.43 +                self._remove_domain(dom, domid)
    1.44 +
    1.45 +
    1.46  
    1.47      def _add_domain(self, info):
    1.48          """Add a domain to the list of running domains