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] Don't auto-add domains we don't know about.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Don't auto-add domains we don't know about.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Jul 2005 13:30:11 -0400
Delivery-date: Wed, 27 Jul 2005 17:30:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 039c7fd6a4d22454ad82b098690dc4007965789d
# Parent  b7e975425dd677520c630f92e2a2d6d2668cb1d5
Don't auto-add domains we don't know about.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r b7e975425dd6 -r 039c7fd6a4d2 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Jul 27 15:32:44 2005
+++ b/tools/python/xen/xend/XendDomain.py       Wed Jul 27 16:57:01 2005
@@ -54,6 +54,10 @@
         self.dbmap = DBMap(db=XenNode("/domain"))
         eserver.subscribe('xend.virq', self.onVirq)
         self.initial_refresh()
+
+        dom0 = self.domain_lookup(0)
+        if not dom0:
+            dom0 = self.domain_unknown(0)
 
     def list(self):
         """Get list of domain objects.
@@ -218,10 +222,6 @@
         if cleanup:
             self.reap()
         doms = self.xen_domains()
-        # Add entries for any domains we don't know about.
-        for id in doms.keys():
-            if id not in self.domains:
-                self.domain_lookup(id)
         # Remove entries for domains that no longer exist.
         # Update entries for existing domains.
         do_domain_restarts = False
@@ -331,22 +331,25 @@
         self.update_domain(id)
         return self.domains.get(id)
 
+    def domain_unknown(self, id):
+        try:
+            info = self.xen_domain(id)
+            if info:
+                uuid = getUuid()
+                log.info(
+                    "Creating entry for unknown domain: id=%d uuid=%s",
+                    id, uuid)
+                db = self.dbmap.addChild(uuid)
+                dominfo = XendDomainInfo.recreate(db, info)
+                dominfo.setdom(id)
+                self._add_domain(dominfo)
+                return dominfo
+        except Exception, ex:
+            log.exception("Error creating domain info: id=%d", id)
+        return None
+        
     def domain_lookup(self, id):
-        dominfo = self.domains.get(id)
-        if not dominfo:
-            try:
-                info = self.xen_domain(id)
-                if info:
-                    uuid = getUuid()
-                    log.info(
-                        "Creating entry for unknown domain: id=%d uuid=%s",
-                        id, uuid)
-                    db = self.dbmap.addChild(uuid)
-                    dominfo = XendDomainInfo.recreate(db, info)
-                    self._add_domain(dominfo)
-            except Exception, ex:
-                log.exception("Error creating domain info: id=%d", id)
-        return dominfo
+        return self.domains.get(id)
 
     def domain_lookup_by_name(self, name):
         dominfo = self.domains.get_by_name(name)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Don't auto-add domains we don't know about., Xen patchbot -unstable <=