diff options
| author | Roger Pau Monné <royger@FreeBSD.org> | 2022-01-13 13:47:18 +0000 |
|---|---|---|
| committer | Roger Pau Monné <royger@FreeBSD.org> | 2022-01-13 15:54:30 +0000 |
| commit | ca46f3289d9630a9b203379333b46f3f11363146 (patch) | |
| tree | 59cdc7ee227e219fc7cf346d131988de1e1f4b69 /sys/dev/xen/control | |
| parent | 9b6aa99e1f20577c361cd57e427a5a95013dbac1 (diff) | |
Diffstat (limited to 'sys/dev/xen/control')
| -rw-r--r-- | sys/dev/xen/control/control.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index 426682a8f2d9..b42b52a62411 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -347,17 +347,12 @@ xctrl_crash() } static void -xen_pv_shutdown_final(void *arg, int howto) +shutdown_final(void *arg, int howto) { - /* - * Inform the hypervisor that shutdown is complete. - * This is not necessary in HVM domains since Xen - * emulates ACPI in that mode and FreeBSD's ACPI - * support will request this transition. - */ - if (howto & (RB_HALT | RB_POWEROFF)) + /* Inform the hypervisor that shutdown is complete. */ + if (howto & RB_POWEROFF) HYPERVISOR_shutdown(SHUTDOWN_poweroff); - else + else if (howto & RB_POWERCYCLE) HYPERVISOR_shutdown(SHUTDOWN_reboot); } @@ -453,9 +448,8 @@ xctrl_attach(device_t dev) xctrl->xctrl_watch.max_pending = 1; xs_register_watch(&xctrl->xctrl_watch); - if (xen_pv_shutdown_handler()) - EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL, - SHUTDOWN_PRI_LAST); + EVENTHANDLER_REGISTER(shutdown_final, shutdown_final, NULL, + SHUTDOWN_PRI_LAST); return (0); } |
