Refresh the domain list on domain_start or domain_create. We need to do this
authorEwan Mellor <ewan@xensource.com>
Wed, 8 Nov 2006 11:13:50 +0000 (11:13 +0000)
committerEwan Mellor <ewan@xensource.com>
Wed, 8 Nov 2006 11:13:50 +0000 (11:13 +0000)
so that the list of running domains is up-to-date for the name-uniqueness
check.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomain.py

index 2015ca7c4b08ec047ae27d35b56a36b9e8027a54..2b37145d54e136ba8ab93c8b1a64eb6354b0446b 100644 (file)
@@ -769,6 +769,8 @@ class XendDomain:
         """
         self.domains_lock.acquire()
         try:
+            self._refresh()
+
             dominfo = XendDomainInfo.create(config)
             self._add_domain(dominfo)
             self.domain_sched_credit_set(dominfo.getDomid(),
@@ -815,6 +817,8 @@ class XendDomain:
         """
         self.domains_lock.acquire()
         try:
+            self._refresh()
+
             dominfo = self.domain_lookup_nr(domid)
             if not dominfo:
                 raise XendInvalidDomain(str(domid))
@@ -824,7 +828,6 @@ class XendDomain:
             
             dominfo.start(is_managed = True)
 
-            
         finally:
             self.domains_lock.release()