ia64/xen-unstable

changeset 13534:f89126a59073

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>
author kfraser@localhost.localdomain
date Fri Jan 19 16:11:31 2007 +0000 (2007-01-19)
parents b4a8000e76db
children 62e2e515febe
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/include/xen/xenbus.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jan 19 16:06:09 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jan 19 16:11:31 2007 +0000
     1.3 @@ -672,6 +672,27 @@ static int suspend_dev(struct device *de
     1.4  	return 0;
     1.5  }
     1.6  
     1.7 +static int suspend_cancel_dev(struct device *dev, void *data)
     1.8 +{
     1.9 +	int err = 0;
    1.10 +	struct xenbus_driver *drv;
    1.11 +	struct xenbus_device *xdev;
    1.12 +
    1.13 +	DPRINTK("");
    1.14 +
    1.15 +	if (dev->driver == NULL)
    1.16 +		return 0;
    1.17 +	drv = to_xenbus_driver(dev->driver);
    1.18 +	xdev = container_of(dev, struct xenbus_device, dev);
    1.19 +	if (drv->suspend_cancel)
    1.20 +		err = drv->suspend_cancel(xdev);
    1.21 +	if (err)
    1.22 +		printk(KERN_WARNING
    1.23 +		       "xenbus: suspend_cancel %s failed: %i\n",
    1.24 +		       dev->bus_id, err);
    1.25 +	return 0;
    1.26 +}
    1.27 +
    1.28  static int resume_dev(struct device *dev, void *data)
    1.29  {
    1.30  	int err;
    1.31 @@ -739,6 +760,8 @@ EXPORT_SYMBOL_GPL(xenbus_resume);
    1.32  void xenbus_suspend_cancel(void)
    1.33  {
    1.34  	xs_suspend_cancel();
    1.35 +	bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_cancel_dev);
    1.36 +	xenbus_backend_resume(suspend_cancel_dev);
    1.37  }
    1.38  EXPORT_SYMBOL_GPL(xenbus_suspend_cancel);
    1.39  
     2.1 --- a/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jan 19 16:06:09 2007 +0000
     2.2 +++ b/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jan 19 16:11:31 2007 +0000
     2.3 @@ -101,6 +101,7 @@ struct xenbus_driver {
     2.4  				 enum xenbus_state backend_state);
     2.5  	int (*remove)(struct xenbus_device *dev);
     2.6  	int (*suspend)(struct xenbus_device *dev);
     2.7 +	int (*suspend_cancel)(struct xenbus_device *dev);
     2.8  	int (*resume)(struct xenbus_device *dev);
     2.9  	int (*uevent)(struct xenbus_device *, char **, int, char *, int);
    2.10  	struct device_driver driver;