xen/control: introduce xen_pv_shutdown_handler()

While x86 only register PV shutdown handler for PV guests. ARM guests
are always using HVM and requires the PV shutdown handler.

Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D29406
This commit is contained in:
Julien Grall 2014-04-05 00:52:05 +01:00 committed by Roger Pau Monné
parent 69c6eee756
commit 0b4f30c236
2 changed files with 8 additions and 1 deletions

View File

@ -446,7 +446,7 @@ xctrl_attach(device_t dev)
xctrl->xctrl_watch.max_pending = 1;
xs_register_watch(&xctrl->xctrl_watch);
if (xen_pv_domain())
if (xen_pv_shutdown_handler())
EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL,
SHUTDOWN_PRI_LAST);

View File

@ -49,6 +49,13 @@ extern int xen_disable_pv_disks;
/* tunable for disabling PV nics */
extern int xen_disable_pv_nics;
static inline bool
xen_pv_shutdown_handler(void)
{
return (xen_pv_domain());
}
static inline bool
xen_pv_disks_disabled(void)
{