From: Paul Durrant Date: Mon, 22 May 2023 13:32:26 +0000 (+0100) Subject: Don't allow a frontend to go from Closed to Initialising... X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1c3bc5f02e700e6e41a40fe7bbadc40ba08a150a;p=pvdrivers%2Fwin%2Fxenvif.git Don't allow a frontend to go from Closed to Initialising... ... if the backend is offline. It's possible for the enumeration thread to spot a device that is in the process of being removed. In this case the 'online' node in the backend XenStore area will be 0 and devices in this state should remain Closed. Signed-off-by: Paul Durrant --- diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c index 7ea66cf..dab0ebb 100644 --- a/src/xenvif/frontend.c +++ b/src/xenvif/frontend.c @@ -1548,8 +1548,12 @@ FrontendPrepare( break; case XenbusStateClosed: - FrontendSetXenbusState(Frontend, - XenbusStateInitialising); + if (FrontendIsBackendOnline(Frontend)) + FrontendSetXenbusState(Frontend, + XenbusStateInitialising); + else + FrontendSetOffline(Frontend); + break; case XenbusStateConnected: