From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Wright Subject: Re: Domains not being destroyed properly Date: Tue, 21 Jun 2011 13:57:20 +0100 Message-ID: <4E009530.2040108@overnetdata.com> References: <4DFB3A90.70707@overnetdata.com> <1308657108.6920.25.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1308657108.6920.25.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 21/06/2011 12:51, Ian Campbell wrote: > On Fri, 2011-06-17 at 12:29 +0100, Anthony Wright wrote: >> If I create a domain with 'xl create -e', and then shut the domain down >> with 'xl shutdown' according to 'xl list' it gets stuck in state >> '--ps-d', with a name of '(none)' and 0 ram, ('xm list' doesn't show the >> domain). >> If I destroy the domain with 'xl destroy' the domain is destroyed properly. >> >> If I create a domain with 'xl create' (without the '-e' option) and then >> use 'xl shutdown', the domain is destroyed properly. >> Since the 'xl shutdown' & 'xl destroy' give different results I presume >> this is a bug. > The -e option to xl create means don't daemonize to babysit this domain. > One of the key bits of functionality of the daemon is to destroy the > domain after it is shutdown. So if you use -e you need to do the destroy > manually. So effectively you have gotten what you asked for ;-) > However I can't destroy the domain with 'xl destroy'. The command runs, but the domain is still there afterwards. >> As an extra question... Is there a way to be notified when a domain is >> destroyed other than leaving the 'xl create' process lying around? I'd >> like to know when any domain is destroyed, and leaving a large number of >> processes lying around just to be able to do this seems rather ugly. In >> the past I've editted some of the python code to achieve this, but my >> patch doesn't work with 4.1, so I'm seeing if there's an official way to >> do this before I work out a new patch. > You can take a xenstore watch on the @releaseDomain pseudo node, does > that do what you want? > I found the @releaseDomain xenstore watch, and have modified my code to use it. I was wondering if there's a mechanism to find out which domain is dying. The only mechanism I can find at the moment is to scan through all the domains to see which one isn't there any more. Assuming 'xl destroy' works, it would make things a little easier. Is there a better way to get the domain states other than doing a 'xl list' and parsing the result? thanks, Anthony.