From 1a37285b5d8fdbc5ef180318bdf42f4d561cbc06 Mon Sep 17 00:00:00 2001 From: Frank Pan Date: Fri, 4 Mar 2011 17:20:04 +0800 Subject: [PATCH] xen: do not set xenstored_ready before xenbus_probe on hvm backport of commit a947f0f8f7012a5e8689a9cff7209ec6964ec154 --- linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c index 3a83ba2..f368db9 100644 --- a/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen/drivers/xen/xenbus/xenbus_probe.c @@ -646,7 +646,10 @@ int register_xenstore_notifier(struct notifier_block *nb) { int ret = 0; - blocking_notifier_chain_register(&xenstore_chain, nb); + if (xenstored_ready > 0) + ret = nb->notifier_call(nb, 0, NULL); + else + blocking_notifier_chain_register(&xenstore_chain, nb); return ret; } @@ -660,7 +663,7 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); void xenbus_probe(struct work_struct *unused) { - BUG_ON((xenstored_ready <= 0)); + xenstored_ready = 1; /* Notify others that xenstore is up */ blocking_notifier_call_chain(&xenstore_chain, 0, NULL); @@ -722,7 +725,6 @@ static int __init xenbus_init(void) xen_store_interface = mfn_to_virt(xen_store_mfn); } else { - xenstored_ready = 1; if (xen_hvm_domain()) { uint64_t v = 0; err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v); @@ -738,6 +740,7 @@ static int __init xenbus_init(void) xen_store_evtchn = xen_start_info->store_evtchn; xen_store_mfn = xen_start_info->store_mfn; xen_store_interface = mfn_to_virt(xen_store_mfn); + xenstored_ready = 1; } } -- 1.7.0.4