[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>
This commit is contained in:
Alastair Tse committed 2006-11-09 16:05:00 +00:00
1 parent f340a1cd64
commit 361ad9ae8b
1 file changed
+3 -3
+3 -3
View File
@@ -319,6 +319,7 @@ class XendDomain:
def _managed_domain_unregister(self, dom):
try:
if self.is_domain_managed(dom):
self._managed_config_remove(dom.get_uuid())
del self.managed_domains[dom.get_uuid()]
except ValueError:
log.warn("Domain is not registered: %s" % dom.get_uuid())
@@ -378,15 +379,14 @@ class XendDomain:
running = self._running_domains()
for dom in running:
domid = dom['domid']
if domid in self.domains:
if domid in self.domains and dom['dying'] != 1:
self.domains[domid].update(dom)
# remove domains that are not running from active domain list.
# The list might have changed by now, because the update call may
# cause new domains to be added, if the domain has rebooted. We get
# the list again.
running = self._running_domains()
running_domids = [d['domid'] for d in running]
running_domids = [d['domid'] for d in running if d['dying'] != 1]
for domid, dom in self.domains.items():
if domid not in running_domids and domid != DOM0_ID:
self._remove_domain(dom, domid)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.