]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[xen] Cope with unexpected initial backend states
authorMichael Brown <mcb30@ipxe.org>
Wed, 13 Aug 2014 23:03:43 +0000 (00:03 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 13 Aug 2014 23:14:51 +0000 (00:14 +0100)
commit8b2942a7dbf664903991b79a8b3317e732e011fa
treeb996d8e6a8d1f0d01dc1daf4a3e562a82a73ffb6
parentbe79ca535ab9891807d8852447d38d35eff3ff63
[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>
src/drivers/net/netfront.c
src/include/ipxe/xenbus.h
src/interface/xen/xenbus.c