Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107060480
D42343.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D42343.diff
View Options
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,18 @@
}
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)
+ /*
+ * Inform the hypervisor that shutdown is complete, and specify the
+ * nature of the shutdown. RB_HALT is not handled by this function.
+ */
+ if (KERNEL_PANICKED())
+ HYPERVISOR_shutdown(SHUTDOWN_crash);
+ else if ((howto & RB_POWEROFF) != 0)
HYPERVISOR_shutdown(SHUTDOWN_poweroff);
- else if (howto & RB_POWERCYCLE)
+ else if ((howto & RB_HALT) == 0)
+ /* RB_POWERCYCLE or regular reset. */
HYPERVISOR_shutdown(SHUTDOWN_reboot);
}
@@ -446,7 +452,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);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 11:54 AM (14 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15742368
Default Alt Text
D42343.diff (1 KB)
Attached To
Mode
D42343: xen: improve shutdown hook
Attached
Detach File
Event Timeline
Log In to Comment