ia64/xen-unstable

changeset 7861:8c736c042f72

Move the registration of the @releaseDomain watch so that we avoid a watch
between the watch firing and the first call to refresh.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Nov 16 15:27:11 2005 +0100 (2005-11-16)
parents 3867d93d86f7
children 3631592ad7d3
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Nov 16 15:25:22 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Nov 16 15:27:11 2005 +0100
     1.3 @@ -63,14 +63,19 @@ class XendDomain:
     1.4          self.domains = {}
     1.5          self.domains_lock = threading.RLock()
     1.6  
     1.7 -        xswatch("@releaseDomain", self.onReleaseDomain)
     1.8 -
     1.9          self.domains_lock.acquire()
    1.10          try:
    1.11              self._add_domain(
    1.12                  XendDomainInfo.recreate(self.xen_domains()[PRIV_DOMAIN],
    1.13                                          True))
    1.14              self.dom0_setup()
    1.15 +
    1.16 +            # This watch registration needs to be before the refresh call, so
    1.17 +            # that we're sure that we haven't missed any releases, but inside
    1.18 +            # the domains_lock, as we don't want the watch to fire until after
    1.19 +            # the refresh call has completed.
    1.20 +            xswatch("@releaseDomain", self.onReleaseDomain)
    1.21 +            
    1.22              self.refresh(True)
    1.23          finally:
    1.24              self.domains_lock.release()