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

[Xen-changelog] [xen-unstable] Add unsuspend hook for resuming devices in the checkpoint parent.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169223091 0
# Node ID f89126a590738ad804463772230dde0b4a6640ba
# Parent  b4a8000e76db6b4b273412b5b7d552fae6168ae6
Add unsuspend hook for resuming devices in the checkpoint parent.

Nothing uses it at the moment.

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c |   23 +++++++++++++++++
 linux-2.6-xen-sparse/include/xen/xenbus.h              |    1 
 2 files changed, 24 insertions(+)

diff -r b4a8000e76db -r f89126a59073 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Fri Jan 19 
16:06:09 2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Fri Jan 19 
16:11:31 2007 +0000
@@ -672,6 +672,27 @@ static int suspend_dev(struct device *de
        return 0;
 }
 
+static int suspend_cancel_dev(struct device *dev, void *data)
+{
+       int err = 0;
+       struct xenbus_driver *drv;
+       struct xenbus_device *xdev;
+
+       DPRINTK("");
+
+       if (dev->driver == NULL)
+               return 0;
+       drv = to_xenbus_driver(dev->driver);
+       xdev = container_of(dev, struct xenbus_device, dev);
+       if (drv->suspend_cancel)
+               err = drv->suspend_cancel(xdev);
+       if (err)
+               printk(KERN_WARNING
+                      "xenbus: suspend_cancel %s failed: %i\n",
+                      dev->bus_id, err);
+       return 0;
+}
+
 static int resume_dev(struct device *dev, void *data)
 {
        int err;
@@ -739,6 +760,8 @@ void xenbus_suspend_cancel(void)
 void xenbus_suspend_cancel(void)
 {
        xs_suspend_cancel();
+       bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_cancel_dev);
+       xenbus_backend_resume(suspend_cancel_dev);
 }
 EXPORT_SYMBOL_GPL(xenbus_suspend_cancel);
 
diff -r b4a8000e76db -r f89126a59073 linux-2.6-xen-sparse/include/xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/xen/xenbus.h Fri Jan 19 16:06:09 2007 +0000
+++ b/linux-2.6-xen-sparse/include/xen/xenbus.h Fri Jan 19 16:11:31 2007 +0000
@@ -101,6 +101,7 @@ struct xenbus_driver {
                                 enum xenbus_state backend_state);
        int (*remove)(struct xenbus_device *dev);
        int (*suspend)(struct xenbus_device *dev);
+       int (*suspend_cancel)(struct xenbus_device *dev);
        int (*resume)(struct xenbus_device *dev);
        int (*uevent)(struct xenbus_device *, char **, int, char *, int);
        struct device_driver driver;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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