diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -345,12 +345,13 @@ } static void -shutdown_final(void *arg, int howto) +xctrl_shutdown_final(void *arg, int howto) { /* Inform the hypervisor that shutdown is complete. */ - if (howto & RB_POWEROFF) + if ((howto & (RB_POWEROFF | RB_HALT)) != 0) HYPERVISOR_shutdown(SHUTDOWN_poweroff); - else if (howto & RB_POWERCYCLE) + else + /* RB_POWERCYCLE or regular reset. */ HYPERVISOR_shutdown(SHUTDOWN_reboot); } @@ -446,7 +447,7 @@ xctrl->xctrl_watch.max_pending = 1; xs_register_watch(&xctrl->xctrl_watch); - EVENTHANDLER_REGISTER(shutdown_final, shutdown_final, NULL, + EVENTHANDLER_REGISTER(shutdown_final, xctrl_shutdown_final, NULL, SHUTDOWN_PRI_LAST); return (0);