aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@xensource.com>2007-02-13 15:32:25 +0000
committerIan Campbell <ian.campbell@xensource.com>2007-02-13 15:32:25 +0000
commit193ca2e8bbd7103200f2786f00a8c06aa54948e3 (patch)
tree2a612843697f05d1a63cf2dc9faa7405ae382f82
parent50cdf11efc6399a99e06bf6e6ee1522cad34bcf5 (diff)
downloadxen-193ca2e8bbd7103200f2786f00a8c06aa54948e3.tar.gz
xen-193ca2e8bbd7103200f2786f00a8c06aa54948e3.tar.bz2
xen-193ca2e8bbd7103200f2786f00a8c06aa54948e3.zip
[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>
-rw-r--r--linux-2.6-xen-sparse/drivers/xen/core/reboot.c3
-rw-r--r--unmodified_drivers/linux-2.6/platform-pci/platform-compat.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
index af3fe3a15c..aab244a738 100644
--- a/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
+++ b/linux-2.6-xen-sparse/drivers/xen/core/reboot.c
@@ -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)
diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
index 5a0bb9bce8..7e1ad1f169 100644
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
@@ -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)
{