From: Ian Jackson Subject: Re: [PATCH 0 of 3] xl and hotplug: Introduce and use shutdown and reboot xm compatibility options Date: Tue, 25 Sep 2012 16:48:16 +0100 Message-ID: <20577.53824.594060.355136@mariner.uk.xensource.com> References: <1348565712.3452.141.camel@zakaz.uk.xensource.com> <15210025463.20120925171143@eikelenboom.it> <1348586949.12592.10.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1348586949.12592.10.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Sander Eikelenboom , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH 0 of 3] xl and hotplug: Introduce and use shutdown and reboot xm compatibility options"): > On Tue, 2012-09-25 at 16:11 +0100, Sander Eikelenboom wrote: > > The only relative simple implementation i thought of was direct > > shutting down all, and when the -w parameter was set, just loop and > > wait on events until the only running domain is domain-0. > > Although this exactly does what has to be done, it somehow sounds a > > bit dirty. > > I think you can allocate an array of libxl_evenable_domain_death*, of > nr_doms in size and then as you shutdown each domain call > libxl_evenable_domain_death for it too. Yes. > Then you loop waiting for destroy events, calling > libxl_evdisable_domain_death as each domain dies, while counting back > from nr_doms until 0. When it reaches 0 everything you asked for has > been shutdown. You can do the disable any time later; leaving it lying around is harmless (although it may leak some memory). Ian.