summaryrefslogtreecommitdiffstats
path: root/src/interface/xen
diff options
context:
space:
mode:
authorMichael Brown2014-08-14 01:03:43 +0200
committerMichael Brown2014-08-14 01:14:51 +0200
commit8b2942a7dbf664903991b79a8b3317e732e011fa (patch)
treeb996d8e6a8d1f0d01dc1daf4a3e562a82a73ffb6 /src/interface/xen
parent[xen] Use version 1 grant tables by default (diff)
downloadipxe-8b2942a7dbf664903991b79a8b3317e732e011fa.tar.gz
ipxe-8b2942a7dbf664903991b79a8b3317e732e011fa.tar.xz
ipxe-8b2942a7dbf664903991b79a8b3317e732e011fa.zip
[xen] Cope with unexpected initial backend states
Under some circumstances (e.g. if iPXE itself is booted via iSCSI, or after an unclean reboot), the backend may not be in the expected InitWait state when iPXE starts up. There is no generic reset mechanism for Xenbus devices. Recent versions of xen-netback will gracefully perform all of the required steps if the frontend sets its state to Initialising. Older versions (such as that found in XenServer 6.2.0) require the frontend to transition through Closed before reaching Initialising. Add a reset mechanism for netfront devices which does the following: - read current backend state - if backend state is anything other than InitWait, then set the frontend state to Closed and wait for the backend to also reach Closed - set the frontend state to Initialising and wait for the backend to reach InitWait. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/xen')
-rw-r--r--src/interface/xen/xenbus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interface/xen/xenbus.c b/src/interface/xen/xenbus.c
index 7ac41899..ffc8aba3 100644
--- a/src/interface/xen/xenbus.c
+++ b/src/interface/xen/xenbus.c
@@ -118,7 +118,7 @@ int xenbus_set_state ( struct xen_device *xendev, int state ) {
* @v xendev Xen device
* @ret state Backend state, or negative error
*/
-static int xenbus_backend_state ( struct xen_device *xendev ) {
+int xenbus_backend_state ( struct xen_device *xendev ) {
unsigned long state;
int rc;