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 watch for domU shutdown

To: David Richardson <daverich04@xxxxxxxxx>
Subject: Re: [Xen-devel] xenstore watch for domU shutdown
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Wed, 10 Jan 2007 11:26:54 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 10 Jan 2007 03:26:35 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <94158.18113.qm@xxxxxxxxxxxxxxxxxxxxxxx>
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: <94158.18113.qm@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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