From: David Richardson <daverich04@yahoo.com>
To: xen-devel@lists.xensource.com
Subject: xenstore watch for domU shutdown
Date: Tue, 9 Jan 2007 18:41:52 -0800 (PST) [thread overview]
Message-ID: <94158.18113.qm@web53108.mail.yahoo.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1015 bytes --]
Hey everyone,
I'm trying to write a simple python program in dom0 that registers a watch on the xenstore to determine when a domU has shutdown. Is there a particular token I should use? Looking through the tools/python/xen/*.py code, I've come across the 'control/shutdown' token... seems promising?
My code is attached below. As is, if fails to call the registered watch function on a domain shutdown. Any help or suggestions would be greatly appreciated. Thanks!
~Dave
#####################BEGIN CODE##############################
from xen.xend.xenstore.xsutil import *
from xen.xend.xenstore.xswatch import *
from sys import argv
from xen.xend.xenstore.xstransact import xstransact
#domid of the domU guest
domid = int(argv[1])
xs = xshandle()
path = xs.get_domain_path(domid)
def myHandleShutdownWatch(_):
f = open("/scratch/TEST", "w")
f.write("Shutdown called")
f.close()
return True
mywatch = xswatch(path+"/control/shutdown",myHandleShutdownWatch)
[-- Attachment #1.2: Type: text/html, Size: 1187 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2007-01-10 2:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-10 2:41 David Richardson [this message]
2007-01-10 11:26 ` xenstore watch for domU shutdown Ewan Mellor
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=94158.18113.qm@web53108.mail.yahoo.com \
--to=daverich04@yahoo.com \
--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.