aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/manage.c
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2010-12-02 12:54:50 -0500
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2011-02-25 11:43:03 -0500
commit702d4eb9b3de4398ab99cf0a4e799e552c7ab756 (patch)
tree8145ce0d54f4f3c3148e188d640f99fc305e8b2a /drivers/xen/manage.c
parentf5412be599602124d2bdd49947b231dd77c0bf99 (diff)
xen: no need to delay xen_setup_shutdown_event for hvm guests anymore
Now that xenstore_ready is used correctly for PV on HVM guests too, we don't need to delay the initialization of xen_setup_shutdown_event anymore. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r--drivers/xen/manage.c17
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
294static 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
306int xen_setup_shutdown_event(void) 294int 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}
315EXPORT_SYMBOL_GPL(xen_setup_shutdown_event); 306EXPORT_SYMBOL_GPL(xen_setup_shutdown_event);
316 307
317subsys_initcall(__setup_shutdown_event); 308subsys_initcall(xen_setup_shutdown_event);