On XenServer the "halt" message is used instead of "poweroff", which

makes FreeBSD halt but not poweroff (as expected when issuing a
shutdown from the VM manager). Fix this by using the same handler
for both "halt" and "poweroff".

NB: The "halt" signal seems to be used on XenServer only.  The OSS
    Xen toolstack (xl) uses "poweroff" instead.

Submitted by:	Roger Pau Monné
Sponsored by:	Citrix Systems R&D
Reviewed by:	gibbs
MFC after:	2 days
This commit is contained in:
gibbs 2013-11-09 03:07:48 +00:00
parent 71c1c69583
commit 629dcaad7d

View File

@ -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 {
@ -441,12 +440,6 @@ xctrl_crash()
panic("Xen directed crash");
}
static void
xctrl_halt()
{
shutdown_nice(RB_HALT);
}
/*------------------------------ Event Reception -----------------------------*/
static void
xctrl_on_watch_event(struct xs_watch *watch, const char **vec, unsigned int len)