direct-io.hg

changeset 12328:de7c20b6eaae

[XEND] Ignore dying domains when refreshing list of domains.

Also cleanup stored configuration if managed domain is deleted.

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Thu Nov 09 16:05:00 2006 +0000 (2006-11-09)
parents ddc4bc24f07c
children b91f42ea5985 3b8c07bd0980
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Nov 09 15:38:15 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Nov 09 16:05:00 2006 +0000
     1.3 @@ -319,6 +319,7 @@ class XendDomain:
     1.4      def _managed_domain_unregister(self, dom):
     1.5          try:
     1.6              if self.is_domain_managed(dom):
     1.7 +                self._managed_config_remove(dom.get_uuid())
     1.8                  del self.managed_domains[dom.get_uuid()]
     1.9          except ValueError:
    1.10              log.warn("Domain is not registered: %s" % dom.get_uuid())
    1.11 @@ -378,15 +379,14 @@ class XendDomain:
    1.12          running = self._running_domains()
    1.13          for dom in running:
    1.14              domid = dom['domid']
    1.15 -            if domid in self.domains:
    1.16 +            if domid in self.domains and dom['dying'] != 1:
    1.17                  self.domains[domid].update(dom)
    1.18  
    1.19          # remove domains that are not running from active domain list.
    1.20          # The list might have changed by now, because the update call may
    1.21          # cause new domains to be added, if the domain has rebooted.  We get
    1.22          # the list again.
    1.23 -        running = self._running_domains()
    1.24 -        running_domids = [d['domid'] for d in running]
    1.25 +        running_domids = [d['domid'] for d in running if d['dying'] != 1]
    1.26          for domid, dom in self.domains.items():
    1.27              if domid not in running_domids and domid != DOM0_ID:
    1.28                  self._remove_domain(dom, domid)