Add unsuspend hook for resuming devices in the checkpoint parent.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 19 Jan 2007 16:11:31 +0000 (16:11 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 19 Jan 2007 16:11:31 +0000 (16:11 +0000)
Nothing uses it at the moment.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
linux-2.6-xen-sparse/include/xen/xenbus.h

index e099114abcbbcefa918c39f2628c629dfe64caaa..584ef079d9a316adbd506a4043d44cabee3a475b 100644 (file)
@@ -672,6 +672,27 @@ static int suspend_dev(struct device *dev, void *data)
        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 @@ EXPORT_SYMBOL_GPL(xenbus_resume);
 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);
 
index 72eb9224acca65cde21844a2c38b895ecfbe4f81..a26ca12820310930e2fffd419975a36941ad15c8 100644 (file)
@@ -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;