From: Ian Jackson Subject: Re: [PATCH] libxl: Make domain_shutdown fail if graceful not possible Date: Thu, 20 Jan 2011 17:05:14 +0000 Message-ID: <19768.27466.652163.392293@mariner.uk.xensource.com> References: <19767.6464.67438.970597@mariner.uk.xensource.com> <1295457314.14981.3660.camel@zakaz.uk.xensource.com> <19768.25441.492749.84174@mariner.uk.xensource.com> <1295542364.14780.62.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: <1295542364.14780.62.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 Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: Make domain_shutdown fail if graceful not possible"): > Acked/Reviewd-by: Ian Campbell Thanks, I've applied it. > Not related to this patch, other than I happened to notice it while > reviewingm but the "req" paramter to libxl_domain_shutdown is pretty > nasty. It can apparently taken a number from 0-4 inclusive, with no > symbolic names, but which are translated per: > > static char *req_table[] = { > [0] = "poweroff", > [1] = "reboot", > [2] = "suspend", > [3] = "crash", > [4] = "halt", > }; Yuk. > However only 0 and 1 are ever actually passed by xl and I'd wager that > only 0, 1 and 4 are even vaguely valid in this context. suspend has it's > own libxl function and iirc crash is something only a guest does... Yes. > I'm not sure what the distinction between poweroff and halt is (pvops > Linux apparently treats them the same) but I'd suggest that having > libxl_domain_shutdown => "poweroff" and libxl_domain_reboot => "reboot" > with the existing function becoming a common internal backend makes > sense. Yes, but for 4.2 I think. Ian.