[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] xenstore watch for domU shutdown
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) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |