ia64/xen-unstable

changeset 11215:3fc16c39f15e

[NET/BLK] back: Change the netback and blkback device drivers to allow
and handle frontend state transition from "Closing" to "Initialising".
Instead of destroying the backend device then they wait for a
reconnect from the frontend. Needed for domU kexec support, to hand over
devices from one kernel instance to the next.

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
author kaf24@localhost.localdomain
date Sat Aug 19 10:20:08 2006 +0100 (2006-08-19)
parents cadf1df88d3e
children 7258181ab445
files linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Sat Aug 19 10:17:48 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Sat Aug 19 10:20:08 2006 +0100
     1.3 @@ -305,6 +305,11 @@ static void frontend_changed(struct xenb
     1.4  
     1.5  	switch (frontend_state) {
     1.6  	case XenbusStateInitialising:
     1.7 +		if (dev->state == XenbusStateClosing) {
     1.8 +			printk("%s: %s: prepare for reconnect\n",
     1.9 +			       __FUNCTION__, dev->nodename);
    1.10 +			xenbus_switch_state(dev, XenbusStateInitWait);
    1.11 +		}
    1.12  		break;
    1.13  
    1.14  	case XenbusStateInitialised:
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Sat Aug 19 10:17:48 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Sat Aug 19 10:20:08 2006 +0100
     2.3 @@ -234,10 +234,25 @@ static void frontend_changed(struct xenb
     2.4  
     2.5  	switch (frontend_state) {
     2.6  	case XenbusStateInitialising:
     2.7 +		if (dev->state == XenbusStateClosing) {
     2.8 +			printk("%s: %s: prepare for reconnect\n",
     2.9 +			       __FUNCTION__, dev->nodename);
    2.10 +			if (be->netif) {
    2.11 +				netif_disconnect(be->netif);
    2.12 +				be->netif = NULL;
    2.13 +			}
    2.14 +			xenbus_switch_state(dev, XenbusStateInitWait);
    2.15 +		}
    2.16 +		break;
    2.17 +
    2.18  	case XenbusStateInitialised:
    2.19  		break;
    2.20  
    2.21  	case XenbusStateConnected:
    2.22 +		if (!be->netif) {
    2.23 +			/* reconnect: setup be->netif */
    2.24 +			backend_changed(&be->backend_watch, NULL, 0);
    2.25 +		}
    2.26  		maybe_connect(be);
    2.27  		break;
    2.28