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] XendDomain.py:

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] XendDomain.py:
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 18 May 2005 15:33:54 +0000
Delivery-date: Wed, 18 May 2005 16:06:24 +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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1452, 2005/05/18 16:33:54+01:00, cl349@xxxxxxxxxxxxxxxxxxxx

        XendDomain.py:
          Bring back refresh() calls but only run the code cleanup parts
          of refresh when necessary.
        Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>



 XendDomain.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)


diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-18 12:07:03 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-18 12:07:03 -04:00
@@ -109,7 +109,7 @@
         """Event handler for virq.
         """
         print 'onVirq>', val
-        self.refresh()
+        self.refresh(cleanup=True)
 
     def rm_all(self):
         """Remove all domain info. Used after reboot.
@@ -154,7 +154,7 @@
                     self._delete_domain(domid)
             else:
                 self._delete_domain(domid)
-        self.refresh()
+        self.refresh(cleanup=True)
 
     def sync(self):
         """Sync domain db to disk.
@@ -274,10 +274,11 @@
             destroyed += 1
             self.final_domain_destroy(id)
 
-    def refresh(self):
+    def refresh(self, cleanup=False):
         """Refresh domain list from Xen.
         """
-        self.reap()
+        if cleanup:
+            self.reap()
         doms = self.xen_domains()
         # Add entries for any domains we don't know about.
         for (id, d) in doms.items():
@@ -294,7 +295,7 @@
                 do_domain_restarts = True
             else:
                 self._delete_domain(d.id)
-        if do_domain_restarts:
+        if cleanup and do_domain_restarts:
             self.scheduler.now(self.domain_restarts)
 
     def update_domain(self, id):
@@ -325,6 +326,7 @@
 
         @return: domain names
         """
+        self.refresh()
         return self.domain_by_name.keys()
 
     def domain_ls_ids(self):
@@ -332,6 +334,7 @@
 
         @return: domain names
         """
+        self.refresh()
         return self.domain_by_id.keys()
 
     def domains(self):
@@ -339,6 +342,7 @@
 
         @return: domain objects
         """
+        self.refresh()
         return self.domain_by_id.values()
     
     def domain_create(self, config):

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

<Prev in Thread] Current Thread [Next in Thread>