From: Ian Campbell Subject: Re: Domains not being destroyed properly Date: Fri, 24 Jun 2011 15:24:30 +0100 Message-ID: <1308925470.32717.115.camel@zakaz.uk.xensource.com> References: <4DFB3A90.70707@overnetdata.com> <1308657108.6920.25.camel@zakaz.uk.xensource.com> <4E009530.2040108@overnetdata.com> <20110621133908.GE5650@dumpdata.com> <4E00B019.5090108@overnetdata.com> <1308671090.6920.89.camel@zakaz.uk.xensource.com> <4E00C0FC.1060305@overnetdata.com> <1308729414.6920.126.camel@zakaz.uk.xensource.com> <4E048921.8000201@overnetdata.com> <1308923134.32717.105.camel@zakaz.uk.xensource.com> <4E049C13.3000805@overnetdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4E049C13.3000805@overnetdata.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: Anthony Wright Cc: "xen-devel@lists.xensource.com" , Rzeszutek Wilk , Konrad List-Id: xen-devel@lists.xenproject.org On Fri, 2011-06-24 at 15:15 +0100, Anthony Wright wrote: > On 24/06/2011 14:45, Ian Campbell wrote: > > On Fri, 2011-06-24 at 13:54 +0100, Anthony Wright wrote: > >> A reaper would have to maintain a list of domains as they were before the > >> notification to compare against the list after the notification to be > >> able to issue a notification for the domain that has died. If that list > >> got out of sync it would start issuing incorrect domain death notifications. > > You don't need to maintain a list, simply call libxl_list_domain() and > > for each returned domain examine the flags and shutdown reason to > > determine if it is dead (and why), dying or still running. > > > > Since you are explicitly arranging that nothing else will destroy > > domains once they die so they will always be in that list when you get > > to them. > My original thought on reaper was that it was only responsible for > helping notify user space applications of a domain's death, but you > seem to be suggesting that it should also be responsible for tidying up > after a domain death as well. Isn't some other part of the system > already fulfilling this role? It would be xl, but you are using xl create -e which explicitly turns off that behaviour. > It seems that for 'xl create' this tidy up is already being done, and I > had presumed the code for 'xl create -e' tidy up already exists but > wasn't working correctly. No, "xl create -e" means "don't babysit this domain waiting for it to die. I, the user, will take care of cleaning it up manually when it dies". You said you were using -e because you didn't want a load of processes sitting around to fulfil this requirement and so I suggested you might like a single reaper daemon which takes case of it instead. Ian. > If you're saying the 'xl create -e' tidy up > code needs to be written, that's probably beyond my knowledge of xen, > and in any case I'm not sure it should be in reaper. Reaper should > notify user space of any domain destruction whether created by 'xl > create -e' or 'xl create'. If reaper did the tidy up for 'xl create -e' > it would have access to information needed to pass to the user space > applications, however for an 'xl create' domain death this information > may no longer be available since 'xl create' may have already tidied up.