aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/manage.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 8943b8ccee1a..07e857b0de13 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -185,6 +185,7 @@ static void shutdown_handler(struct xenbus_watch *watch,
185 kfree(str); 185 kfree(str);
186} 186}
187 187
188#ifdef CONFIG_MAGIC_SYSRQ
188static void sysrq_handler(struct xenbus_watch *watch, const char **vec, 189static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
189 unsigned int len) 190 unsigned int len)
190{ 191{
@@ -214,15 +215,16 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec,
214 handle_sysrq(sysrq_key, NULL); 215 handle_sysrq(sysrq_key, NULL);
215} 216}
216 217
217static struct xenbus_watch shutdown_watch = {
218 .node = "control/shutdown",
219 .callback = shutdown_handler
220};
221
222static struct xenbus_watch sysrq_watch = { 218static struct xenbus_watch sysrq_watch = {
223 .node = "control/sysrq", 219 .node = "control/sysrq",
224 .callback = sysrq_handler 220 .callback = sysrq_handler
225}; 221};
222#endif
223
224static struct xenbus_watch shutdown_watch = {
225 .node = "control/shutdown",
226 .callback = shutdown_handler
227};
226 228
227static int setup_shutdown_watcher(void) 229static int setup_shutdown_watcher(void)
228{ 230{
@@ -234,11 +236,13 @@ static int setup_shutdown_watcher(void)
234 return err; 236 return err;
235 } 237 }
236 238
239#ifdef CONFIG_MAGIC_SYSRQ
237 err = register_xenbus_watch(&sysrq_watch); 240 err = register_xenbus_watch(&sysrq_watch);
238 if (err) { 241 if (err) {
239 printk(KERN_ERR "Failed to set sysrq watcher\n"); 242 printk(KERN_ERR "Failed to set sysrq watcher\n");
240 return err; 243 return err;
241 } 244 }
245#endif
242 246
243 return 0; 247 return 0;
244} 248}