# HG changeset patch
# User Brendan Cully <brendan@xxxxxxxxx>
# Date 1168891374 28800
# Node ID 70508fff24c52b7b16ea6c7be630a43cca45a5e1
# Parent 1a3b78919a43a68948775eb4077f5dab62054f7c
Add unsuspend hook for resuming devices in the checkpoint parent.
Nothing uses it at the moment.
Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
diff -r 1a3b78919a43 -r 70508fff24c5
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Mon Jan 15
12:02:54 2007 -0800
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Mon Jan 15
12:02:54 2007 -0800
@@ -672,6 +672,26 @@ static int suspend_dev(struct device *de
return 0;
}
+static int unsuspend_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->unsuspend)
+ err = drv->unsuspend(xdev);
+ if (err)
+ printk(KERN_WARNING
+ "xenbus: unsuspend %s failed: %i\n", dev->bus_id, err);
+ return 0;
+}
+
static int resume_dev(struct device *dev, void *data)
{
int err;
@@ -735,6 +755,9 @@ void xenbus_resume(int reconnect)
if (reconnect) {
bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, resume_dev);
+ } else {
+ bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL,
+ unsuspend_dev);
}
xenbus_backend_resume(resume_dev);
}
diff -r 1a3b78919a43 -r 70508fff24c5 linux-2.6-xen-sparse/include/xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/xen/xenbus.h Mon Jan 15 12:02:54 2007 -0800
+++ b/linux-2.6-xen-sparse/include/xen/xenbus.h Mon Jan 15 12:02:54 2007 -0800
@@ -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 (*unsuspend)(struct xenbus_device *dev);
int (*resume)(struct xenbus_device *dev);
int (*uevent)(struct xenbus_device *, char **, int, char *, int);
struct device_driver driver;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|