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] Silence log message when trying to unregi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Silence log message when trying to unregister a watch that's already been
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 29 Nov 2006 14:00:19 +0000
Delivery-date: Wed, 29 Nov 2006 06:00:29 -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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 07e3f39eaf10f098058497e72f7cd828fa44562b
# Parent  53795f0a41b116d0fb428bd3ee4a099b42fca97f
Silence log message when trying to unregister a watch that's already been
unregistered -- this is not a problem.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/xenstore/xswatch.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff -r 53795f0a41b1 -r 07e3f39eaf10 tools/python/xen/xend/xenstore/xswatch.py
--- a/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 29 12:16:59 2006 +0000
+++ b/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 29 12:14:45 2006 +0000
@@ -5,6 +5,7 @@
 # Public License.  See the file "COPYING" in the main directory of
 # this archive for more details.
 
+import errno
 import threading
 from xen.xend.xenstore.xsutil import xshandle
 
@@ -65,7 +66,15 @@ def watchMain():
             watch = we[1]
             res = watch.fn(we[0], *watch.args, **watch.kwargs)
             if not res:
-                watch.unwatch()
+                try:
+                    watch.unwatch()
+                except RuntimeError, exn:
+                    if exn.args[0] == errno.ENOENT:
+                        # The watch has already been unregistered -- that's
+                        # fine.
+                        pass
+                    else:
+                        raise
         except:
             log.exception("read_watch failed")
             # Ignore this exception -- there's no point throwing it

_______________________________________________
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] Silence log message when trying to unregister a watch that's already been, Xen patchbot-unstable <=