From owner-freebsd-xen@FreeBSD.ORG Mon Oct 21 15:20:02 2013 Return-Path: Delivered-To: freebsd-xen@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 06E575F8 for ; Mon, 21 Oct 2013 15:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5EF32EB7 for ; Mon, 21 Oct 2013 15:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9LFK135076845 for ; Mon, 21 Oct 2013 15:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9LFK12g076844; Mon, 21 Oct 2013 15:20:01 GMT (envelope-from gnats) Date: Mon, 21 Oct 2013 15:20:01 GMT Message-Id: <201310211520.r9LFK12g076844@freefall.freebsd.org> To: freebsd-xen@FreeBSD.org Cc: From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: kern/171118: [xen] FreeBSD XENHVM guest doesn't shutdown cleanly X-BeenThere: freebsd-xen@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= List-Id: Discussion of the freebsd port to xen - implementation and usage List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 15:20:02 -0000 The following reply was made to PR kern/171118; it has been noted by GNATS. From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= To: , Cc: Subject: Re: kern/171118: [xen] FreeBSD XENHVM guest doesn't shutdown cleanly Date: Mon, 21 Oct 2013 16:18:34 +0100 When using libxl the event sent is a "poweroff", but I guess XenServer toolstack is sending a "halt" event instead (which libxl doesn't use for anything). The following patch wires the "halt" event handler to the "poweroff" handler and removes the now unused "halt" handler. I'm currently on a trip, so I haven't been able to test the patch (not even compile tested). --- diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index 35c923d..78894ba 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -158,7 +158,6 @@ static xctrl_shutdown_handler_t xctrl_poweroff; static xctrl_shutdown_handler_t xctrl_reboot; static xctrl_shutdown_handler_t xctrl_suspend; static xctrl_shutdown_handler_t xctrl_crash; -static xctrl_shutdown_handler_t xctrl_halt; /*-------------------------- Private Data Structures -------------------------*/ /** Element type for lookup table of event name to handler. */ @@ -173,7 +172,7 @@ static const struct xctrl_shutdown_reason xctrl_shutdown_reasons[] = { { "reboot", xctrl_reboot }, { "suspend", xctrl_suspend }, { "crash", xctrl_crash }, - { "halt", xctrl_halt }, + { "halt", xctrl_poweroff }, }; struct xctrl_softc { @@ -427,12 +426,6 @@ xctrl_crash() } static void -xctrl_halt() -{ - shutdown_nice(RB_HALT); -} - -static void xen_pv_shutdown_final(void *arg, int howto) { /*