diff options
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r-- | drivers/xen/manage.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 24177272bcb8..b2a8d7856ce3 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -291,27 +291,18 @@ static int shutdown_event(struct notifier_block *notifier, | |||
291 | return NOTIFY_DONE; | 291 | return NOTIFY_DONE; |
292 | } | 292 | } |
293 | 293 | ||
294 | static int __init __setup_shutdown_event(void) | ||
295 | { | ||
296 | /* Delay initialization in the PV on HVM case */ | ||
297 | if (xen_hvm_domain()) | ||
298 | return 0; | ||
299 | |||
300 | if (!xen_pv_domain()) | ||
301 | return -ENODEV; | ||
302 | |||
303 | return xen_setup_shutdown_event(); | ||
304 | } | ||
305 | |||
306 | int xen_setup_shutdown_event(void) | 294 | int xen_setup_shutdown_event(void) |
307 | { | 295 | { |
308 | static struct notifier_block xenstore_notifier = { | 296 | static struct notifier_block xenstore_notifier = { |
309 | .notifier_call = shutdown_event | 297 | .notifier_call = shutdown_event |
310 | }; | 298 | }; |
299 | |||
300 | if (!xen_domain()) | ||
301 | return -ENODEV; | ||
311 | register_xenstore_notifier(&xenstore_notifier); | 302 | register_xenstore_notifier(&xenstore_notifier); |
312 | 303 | ||
313 | return 0; | 304 | return 0; |
314 | } | 305 | } |
315 | EXPORT_SYMBOL_GPL(xen_setup_shutdown_event); | 306 | EXPORT_SYMBOL_GPL(xen_setup_shutdown_event); |
316 | 307 | ||
317 | subsys_initcall(__setup_shutdown_event); | 308 | subsys_initcall(xen_setup_shutdown_event); |