]> xenbits.xensource.com Git - pvdrivers/win/xenvif.git/commitdiff
Don't allow a frontend to go from Closed to Initialising...
authorPaul Durrant <pdurrant@amazon.com>
Mon, 22 May 2023 13:32:26 +0000 (14:32 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Mon, 22 May 2023 13:33:30 +0000 (14:33 +0100)
... 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 <pdurrant@amazon.com>
src/xenvif/frontend.c

index 7ea66cf73610a5e0e90a68f7b92447df7591013b..dab0ebbec0e4ee94697df7a85ac8a6217ebadb5e 100644 (file)
@@ -1548,8 +1548,12 @@ FrontendPrepare(
             break;
 
         case XenbusStateClosed:
-            FrontendSetXenbusState(Frontend,
-                                   XenbusStateInitialising);
+            if (FrontendIsBackendOnline(Frontend))
+                FrontendSetXenbusState(Frontend,
+                                       XenbusStateInitialising);
+            else
+                FrontendSetOffline(Frontend);
+
             break;
 
         case XenbusStateConnected: