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-devel

Re: [Xen-devel] xenstore watches not firing for external-to-xend code us

To: Charles Duffy <cduffy@xxxxxxxxxxx>
Subject: Re: [Xen-devel] xenstore watches not firing for external-to-xend code using xen.xend.xenstore classes
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 9 Feb 2006 08:55:42 -0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 09 Feb 2006 17:13:56 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <dsfr19$ccv$1@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <dsfr19$ccv$1@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Feb 09, 2006 at 10:35:50AM -0600, Charles Duffy wrote:

> I'm trying to write a simple xenstore-based watchdog, as discussed 
> previously on this list (quite some time ago -- it got pushed to the 
> back of my priority list for a bit).
>
> [Snip]
>
> 
> #!/usr/bin/env python
> 
> from xen.xend.xenstore.xstransact import xstransact
> from xen.xend.xenstore.xswatch import xswatch
> 
> from pprint import pprint
> import time, logging
> logging.basicConfig(level=logging.DEBUG)
> 
> TROOT = '/tool/watchdog'
> 
> class XenWatchdog:
>   def __init__(self):
>     xswatch('@releaseDomain', self.callback, 'releaseDomain')
>     xswatch('@introduceDomain', self.callback, 'introduceDomain')
>     xswatch('%(TROOT)s/test' % locals(), self.callback, 'test')
>   def callback(self, *args, **kwargs):
>     pprint([ 'onReleaseDomain', args, kwargs ])

callback needs to return True to say that it would like to stay
registered.  As it is, you are returning nothing, which looks like
False, which means your callback is deregistered after the first call.

This changed a couple of months ago, and it still bites people.  (My
kingdom for a static type system ;-)

Ewan.

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

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