mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
[LINUX] Call ctrl_alt_del() to trigger a reboot so we benefit from the
generic infrastructure for cad_pid etc. Add a ctrl_alt_del() implemenation to the PV on HVM compatibility layer since ctrl_alt_del() is not exported on native kernels. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
This commit is contained in:
1 parent
50cdf11efc
commit
193ca2e8bb
2 files changed
+8
-1
No files matched your search
@@ -100,6 +100,7 @@ static void __shutdown_handler(void *unused)
|
||||
static void shutdown_handler(struct xenbus_watch *watch,
|
||||
const char **vec, unsigned int len)
|
||||
{
|
||||
extern void ctrl_alt_del(void);
|
||||
char *str;
|
||||
struct xenbus_transaction xbt;
|
||||
int err;
|
||||
@@ -129,7 +130,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
|
||||
if (strcmp(str, "poweroff") == 0)
|
||||
shutting_down = SHUTDOWN_POWEROFF;
|
||||
else if (strcmp(str, "reboot") == 0)
|
||||
kill_proc(1, SIGINT, 1); /* interrupt init */
|
||||
ctrl_alt_del();
|
||||
else if (strcmp(str, "suspend") == 0)
|
||||
shutting_down = SHUTDOWN_SUSPEND;
|
||||
else if (strcmp(str, "halt") == 0)
|
||||
|
||||
@@ -13,6 +13,12 @@ static int system_state = 1;
|
||||
EXPORT_SYMBOL(system_state);
|
||||
#endif
|
||||
|
||||
static inline void ctrl_alt_del(void)
|
||||
{
|
||||
kill_proc(1, SIGINT, 1); /* interrupt init */
|
||||
}
|
||||
EXPORT_SYMBOL(ctrl_alt_del);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
|
||||
size_t strcspn(const char *s, const char *reject)
|
||||
{
|
||||
|
||||