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] Remove the watch on the /vm/<uuid> path when rebooting o

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Remove the watch on the /vm/<uuid> path when rebooting or migrating. We don't
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 03 Dec 2005 12:04:09 +0000
Delivery-date: Sat, 03 Dec 2005 12:04:43 +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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID d581e11e247c72ac48ae5be69fd5c08a823dd655
# Parent  f23db20517850e84fbc40fe3c09211d9f5defa39
Remove the watch on the /vm/<uuid> path when rebooting or migrating.  We don't
want to end up with multiple watches on the same path, otherwise we get a
watch event storm after many such reboots or migrates.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r f23db2051785 -r d581e11e247c tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Dec  2 15:35:22 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Dec  2 15:36:39 2005
@@ -775,7 +775,10 @@
                     if reason == 'suspend':
                         self.state_set(STATE_DOM_SHUTDOWN)
                         # Don't destroy the domain.  XendCheckpoint will do
-                        # this once it has finished.
+                        # this once it has finished.  However, stop watching
+                        # the VM path now, otherwise we will end up with one
+                        # watch for the old domain, and one for the new.
+                        self.unwatchVm()
                     elif reason in ['poweroff', 'reboot']:
                         restart_reason = reason
                     else:
@@ -1185,18 +1188,31 @@
     def cleanupVm(self):
         """Cleanup VM resources.  Idempotent.  Nothrow guarantee."""
 
+        self.unwatchVm()
+
+        try:
+            self.removeVm()
+        except:
+            log.exception("Removing VM path failed.")
+
+
+    ## private:
+
+    def unwatchVm(self):
+        """Remove the watch on the VM path, if any.  Idempotent.  Nothrow
+        guarantee."""
+
         try:
             try:
                 if self.vmWatch:
                     self.vmWatch.unwatch()
+            finally:
                 self.vmWatch = None
-            except:
-                log.exception("Unwatching VM path failed.")
-
-            self.removeVm()
         except:
-            log.exception("Removing VM path failed.")
-
+            log.exception("Unwatching VM path failed.")
+
+
+    ## public:
 
     def destroy(self):
         """Cleanup VM and destroy domain.  Nothrow guarantee."""
@@ -1351,6 +1367,7 @@
             if rename:
                 self.preserveForRestart()
             else:
+                self.unwatchVm()
                 self.destroyDomain()
 
             # new_dom's VM will be the same as this domain's VM, except where
@@ -1387,6 +1404,7 @@
         log.info("Renaming dead domain %s (%d, %s) to %s (%s).",
                  self.info['name'], self.domid, self.info['uuid'],
                  new_name, new_uuid)
+        self.unwatchVm()
         self.release_devices()
         self.info['name'] = new_name
         self.info['uuid'] = new_uuid
@@ -1398,6 +1416,7 @@
     def preserve(self):
         log.info("Preserving dead domain %s (%d).", self.info['name'],
                  self.domid)
+        self.unwatchVm()
         self.storeDom('xend/shutdown_completed', 'True')
         self.state_set(STATE_DOM_SHUTDOWN)
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Remove the watch on the /vm/<uuid> path when rebooting or migrating. We don't, Xen patchbot -unstable <=