From: Ewan Mellor <ewan@xensource.com>
To: Charles Duffy <cduffy@spamcop.net>
Cc: xen-devel@lists.xensource.com
Subject: Re: xenstore watches not firing for external-to-xend code using xen.xend.xenstore classes
Date: Thu, 9 Feb 2006 08:55:42 -0800 [thread overview]
Message-ID: <20060209165541.GA3151@localhost.localdomain> (raw)
In-Reply-To: <dsfr19$ccv$1@sea.gmane.org>
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.
next prev parent reply other threads:[~2006-02-09 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-09 16:35 xenstore watches not firing for external-to-xend code using xen.xend.xenstore classes Charles Duffy
2006-02-09 16:55 ` Ewan Mellor [this message]
2006-02-09 17:16 ` Charles Duffy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060209165541.GA3151@localhost.localdomain \
--to=ewan@xensource.com \
--cc=cduffy@spamcop.net \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.