On Tue, Jan 09, 2007 at 06:41:52PM -0800, David Richardson wrote:
> 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?
control/shutdown is an instruction from the tools to the domU that it should
shut down. What it doesn''t tell you is when a domain has gone away,
because
if it shuts down of its own accord or crashes, of course there won''t be
anything here.
The store will fire @releaseDomain whenever a domain goes away -- you then
need to read from Xen to find out if its the one that you''re interested
in.
Read through XendDomainInfo.refreshShutdown; the watch itself is registered in
XendDomain.
If you''re using Xend it''s a little bit complicated, because
Xend is going to
clean up the domain under your feet, reboot it, and so on, so if you''re
using
Xend, the easiest way would be either to modify Xend, and add a hook for what
you want, or to watch @releaseDomain, read from Xen to see what has shut down,
and if Xend has already cleaned up after the domain then read
xend/last_shutdown_reason to find out what happened. (last_shutdown_reason
appeared in very recent xen-unstable.)
Ewan.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel