diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-19 16:11:31 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-19 16:11:31 +0000 |
commit | f272b206703b3e8c5f12683475976dd77e5ecbf7 (patch) | |
tree | 7b344c1e4d23f3018a92b0fc818972d2a5efd5d2 /linux-2.6-xen-sparse | |
parent | 931818cacb428305d95a131ba40bfa92df4b1c39 (diff) | |
download | xen-f272b206703b3e8c5f12683475976dd77e5ecbf7.tar.gz xen-f272b206703b3e8c5f12683475976dd77e5ecbf7.tar.bz2 xen-f272b206703b3e8c5f12683475976dd77e5ecbf7.zip |
Add unsuspend hook for resuming devices in the checkpoint parent.
Nothing uses it at the moment.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Diffstat (limited to 'linux-2.6-xen-sparse')
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c | 23 | ||||
-rw-r--r-- | linux-2.6-xen-sparse/include/xen/xenbus.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index e099114abc..584ef079d9 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -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); diff --git a/linux-2.6-xen-sparse/include/xen/xenbus.h b/linux-2.6-xen-sparse/include/xen/xenbus.h index 72eb9224ac..a26ca12820 100644 --- a/linux-2.6-xen-sparse/include/xen/xenbus.h +++ b/linux-2.6-xen-sparse/include/xen/xenbus.h @@ -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; |