mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1159.6.2 (41176d3eHxHC1VGHGu53bIhNRwFGGg)
Keep domain list up-to-date on domain shutdown.
This commit is contained in:
1 parent
3d3c4e1d63
commit
754df6c6f4
1 file changed
+7
-1
@@ -232,17 +232,23 @@ class XendDomain:
|
||||
not(d['running'] or d['paused'] or d['blocked']))
|
||||
if dead:
|
||||
casualties.append(d)
|
||||
destroyed = 0
|
||||
for d in casualties:
|
||||
id = str(d['dom'])
|
||||
log.debug('XendDomain>reap> domain died id=%s', id)
|
||||
if d['shutdown']:
|
||||
reason = XendDomainInfo.shutdown_reason(d['shutdown_reason'])
|
||||
log.debug('XendDomain>reap> shutdown id=%s reason=%s', id, reason)
|
||||
if reason in ['suspend']:
|
||||
continue
|
||||
if reason in ['poweroff', 'reboot']:
|
||||
self.domain_restart_schedule(id, reason)
|
||||
destroyed += 1
|
||||
self.final_domain_destroy(id)
|
||||
if self.domain_restarts_exist():
|
||||
self.domain_restarts_schedule()
|
||||
if destroyed:
|
||||
self.refresh_schedule(delay=1)
|
||||
|
||||
def refresh(self):
|
||||
"""Refresh domain list from Xen.
|
||||
@@ -268,7 +274,7 @@ class XendDomain:
|
||||
d.update(info)
|
||||
else:
|
||||
self._delete_domain(d.id)
|
||||
self.reap_schedule(1)
|
||||
self.reap_schedule(delay=1)
|
||||
|
||||
def update_domain(self, id):
|
||||
"""Update the saved info for a domain.
|
||||
|
||||