From: Gerd Hoffmann <kraxel@suse.de>
To: Xen devel list <xen-devel@lists.xensource.com>
Subject: [patch 3/6] allow reconnects to the backend driver
Date: Thu, 17 Aug 2006 15:49:22 +0200 [thread overview]
Message-ID: <44E473E2.5040308@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
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@suse.de>
http://www.suse.de/~kraxel/julika-dora.jpeg
[-- Attachment #2: backend-reconnect --]
[-- Type: text/plain, Size: 1663 bytes --]
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
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;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2006-08-17 13:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44E473E2.5040308@suse.de \
--to=kraxel@suse.de \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.