[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/2] xenbus: bypass xenbus frontend resume if xenstored is not running

If the xenbus frontend is running in a domain running xenstored or in dom0,
the device resume is hanging because it is happening before the process
resume. This patch adds extra logic to the resume code to check if we are
the domain running xenstored or dom0.

The frontend will be reconnected later, when the backend resumes from S3.
This logic is working when xenstored is running in dom0, but has not been
tested with a xenstore stub domain.
 drivers/xen/xenbus/xenbus_probe_frontend.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c 
index 3159a37..8583afe 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -89,9 +89,22 @@ static void backend_changed(struct xenbus_watch *watch,
        xenbus_otherend_changed(watch, vec, len, 1);
+static int xenbus_frontend_dev_resume(struct device *dev)
+       /* 
+        * If xenstored is running in that domain, we cannot access the backend
+        * state at the moment. If we are running in dom0, the domain running
+        * xenstored is still suspended at that point
+        */
+       if (xen_initial_domain() || (xen_store_domain == XS_LOCAL))
+               return 0;
+       return xenbus_dev_resume(dev);
 static const struct dev_pm_ops xenbus_pm_ops = {
        .suspend        = xenbus_dev_suspend,
-       .resume         = xenbus_dev_resume,
+       .resume         = xenbus_frontend_dev_resume,
        .freeze         = xenbus_dev_suspend,
        .thaw           = xenbus_dev_cancel,
        .restore        = xenbus_dev_resume,

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.