From: Sander Eikelenboom Subject: Re: [PATCH 0 of 3] xl and hotplug: Introduce and use shutdown and reboot xm compatibility options Date: Tue, 25 Sep 2012 17:47:21 +0200 Message-ID: <148921897.20120925174721@eikelenboom.it> 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: "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org Tuesday, September 25, 2012, 5:29:09 PM, you wrote: > 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. > 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. Depends a bit on what you expect -a to do, especially in combination with -w. The wait gives quite a window for a new guest to be created in the mean time. The usage in the init.d/xendomains script is as a sort of "catch all", since the iteration is in the script it self. So for that purpose i would assume that a "xl shutdown -a -w" would shutdown all domains until only dom-0 remains, and not only shutdown the domains that were running at the time the command was actually issued. > Or something like that, I've not actually implemented it ;-) > Ian.