WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch 3/6] allow reconnects to the backend driver

To: Xen devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [patch 3/6] allow reconnects to the backend driver
From: Gerd Hoffmann <kraxel@xxxxxxx>
Date: Thu, 17 Aug 2006 15:49:22 +0200
Delivery-date: Thu, 17 Aug 2006 06:49:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.5 (X11/20060725)
  Hi,

The patch below changes 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.

please apply,

  Gerd

-- 
Gerd Hoffmann <kraxel@xxxxxxx>
http://www.suse.de/~kraxel/julika-dora.jpeg
Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxx>
Index: source-lnx-stable-22813/drivers/xen/blkback/xenbus.c
===================================================================
--- source-lnx-stable-22813.orig/drivers/xen/blkback/xenbus.c   2006-08-17 
15:19:20.000000000 +0200
+++ source-lnx-stable-22813/drivers/xen/blkback/xenbus.c        2006-08-17 
15:20:17.000000000 +0200
@@ -305,6 +305,11 @@ static void frontend_changed(struct xenb
 
        switch (frontend_state) {
        case XenbusStateInitialising:
+               if (dev->state == XenbusStateClosing) {
+                       printk("%s: %s: prepare for reconnect\n",
+                              __FUNCTION__, dev->nodename);
+                       xenbus_switch_state(dev, XenbusStateInitWait);
+               }
                break;
 
        case XenbusStateInitialised:
Index: source-lnx-stable-22813/drivers/xen/netback/xenbus.c
===================================================================
--- source-lnx-stable-22813.orig/drivers/xen/netback/xenbus.c   2006-08-17 
15:19:20.000000000 +0200
+++ source-lnx-stable-22813/drivers/xen/netback/xenbus.c        2006-08-17 
15:20:17.000000000 +0200
@@ -228,10 +228,25 @@ static void frontend_changed(struct xenb
 
        switch (frontend_state) {
        case XenbusStateInitialising:
+               if (dev->state == XenbusStateClosing) {
+                       printk("%s: %s: prepare for reconnect\n",
+                              __FUNCTION__, dev->nodename);
+                       if (be->netif) {
+                               netif_disconnect(be->netif);
+                               be->netif = NULL;
+                       }
+                       xenbus_switch_state(dev, XenbusStateInitWait);
+               }
+               break;
+
        case XenbusStateInitialised:
                break;
 
        case XenbusStateConnected:
+               if (!be->netif) {
+                       /* reconnect: setup be->netif */
+                       backend_changed(&be->backend_watch, NULL, 0);
+               }
                maybe_connect(be);
                break;
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [patch 3/6] allow reconnects to the backend driver, Gerd Hoffmann <=