WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Fix domain_lookup_nr to check mana

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix domain_lookup_nr to check managed_domains too.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 09 Nov 2006 18:40:15 +0000
Delivery-date: Thu, 09 Nov 2006 10:40:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID 023aa2926e7971eeb2fe208f987d2f2a20e824f0
# Parent  33ae8ae8693c7a1620798adadfdf99be02be367d
[XEND] Fix domain_lookup_nr to check managed_domains too.

Bug introduced when moving managed domains out of self.domains caused
domain_lookup_nr ignoring managed domains.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff -r 33ae8ae8693c -r 023aa2926e79 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Nov 09 12:36:20 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Thu Nov 09 12:38:12 2006 +0000
@@ -57,10 +57,10 @@ class XendDomain:
 class XendDomain:
     """Index of all domains. Singleton.
 
-    @ivar domains: map of domains indexed by UUID Strings
+    @ivar domains: map of domains indexed by domid
     @type domains: dict of XendDomainInfo
-    @ivar managed_domains: uuid of domains that are managed by Xend
-    @type managed_domains: list of (uuids, dom_name)
+    @ivar managed_domains: domains that are not running and managed by Xend
+    @type managed_domains: dict of XendDomainInfo indexed by uuid
     @ivar domains_lock: lock that must be held when manipulating self.domains
     @type domains_lock: threaading.RLock
     @ivar _allow_new_domains: Flag to set that allows creating of new domains.
@@ -484,12 +484,27 @@ class XendDomain:
             if match:
                 return match[0]
 
+            match = [dom for dom in self.managed_domains.values() \
+                     if dom.getName() == domid]
+            if match:
+                return match[0]
+
             # lookup by id
             try:
                 if int(domid) in self.domains:
                     return self.domains[int(domid)]
             except ValueError:
                 pass
+
+            # lookup by uuid for running domains
+            match = [dom for dom in self.domains.values() \
+                     if dom.get_uuid() == domid]
+            if match:
+                return match[0]
+
+            # lookup by uuid for inactive managed domains 
+            if domid in self.managed_domains:
+                return self.managed_domains[domid]
 
             return None
         finally:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Fix domain_lookup_nr to check managed_domains too., Xen patchbot-unstable <=