ia64/xen-unstable

changeset 2133:0219fa720732

bitkeeper revision 1.1159.6.2 (41176d3eHxHC1VGHGu53bIhNRwFGGg)

Keep domain list up-to-date on domain shutdown.
author mjw@wray-m-3.hpl.hp.com
date Mon Aug 09 12:25:34 2004 +0000 (2004-08-09)
parents 66687fe8d1c7
children 9c32df6c75a7
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Mon Aug 09 09:50:15 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Mon Aug 09 12:25:34 2004 +0000
     1.3 @@ -232,17 +232,23 @@ class XendDomain:
     1.4                              not(d['running'] or d['paused'] or d['blocked']))
     1.5              if dead:
     1.6                  casualties.append(d)
     1.7 +        destroyed = 0
     1.8          for d in casualties:
     1.9              id = str(d['dom'])
    1.10              log.debug('XendDomain>reap> domain died id=%s', id)
    1.11              if d['shutdown']:
    1.12                  reason = XendDomainInfo.shutdown_reason(d['shutdown_reason'])
    1.13                  log.debug('XendDomain>reap> shutdown id=%s reason=%s', id, reason)
    1.14 +                if reason in ['suspend']:
    1.15 +                    continue
    1.16                  if reason in ['poweroff', 'reboot']:
    1.17                      self.domain_restart_schedule(id, reason)
    1.18 +            destroyed += 1
    1.19              self.final_domain_destroy(id)
    1.20          if self.domain_restarts_exist():
    1.21              self.domain_restarts_schedule()
    1.22 +        if destroyed:
    1.23 +            self.refresh_schedule(delay=1)
    1.24  
    1.25      def refresh(self):
    1.26          """Refresh domain list from Xen.
    1.27 @@ -268,7 +274,7 @@ class XendDomain:
    1.28                  d.update(info)
    1.29              else:
    1.30                  self._delete_domain(d.id)
    1.31 -        self.reap_schedule(1)
    1.32 +        self.reap_schedule(delay=1)
    1.33  
    1.34      def update_domain(self, id):
    1.35          """Update the saved info for a domain.