[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/5] Watch BACKEND/state key for eject status


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Tu Dinh" <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Thu, 16 Apr 2026 11:10:00 +0000
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=mte1 header.d=mandrillapp.com header.i="@mandrillapp.com" header.h="From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mte1 header.d=vates.tech header.i="ngoc-tu.dinh@xxxxxxxxxx" header.h="From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"
  • Cc: "Tu Dinh" <ngoc-tu.dinh@xxxxxxxxxx>, "Owen Smith" <owen.smith@xxxxxxxxxx>, "Paul Durrant" <xadimgnik@xxxxxxxxx>
  • Delivery-date: Thu, 16 Apr 2026 11:10:05 +0000
  • Feedback-id: 30504962:30504962.20260416:md
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

The frontend eject thread watches for writes to BACKEND/online to detect
an orderly device eject. However, BACKEND/online is also written during
a forced removal of the VIF, where the entire backend key is removed
shortly after. This in turn causes NDIS to hang waiting for packets to
be returned, in the absence of hang detection.

Move the eject thread's watch onto BACKEND/state instead. This delays
the FrontendEject watch just enough that it fires after FdoScan, and so
leaves an opportunity for FdoScan to trigger a surprise removal.

Suggested-by: Paul Durrant <xadimgnik@xxxxxxxxx>
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xenvif/frontend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index 5311dea..5cdb9a1 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1603,7 +1603,7 @@ FrontendPrepare(
     status = XENBUS_STORE(WatchAdd,
                           &Frontend->StoreInterface,
                           __FrontendGetBackendPath(Frontend),
-                          "online",
+                          "state",
                           ThreadGetEvent(Frontend->EjectThread),
                           &Frontend->Watch);
     if (!NT_SUCCESS(status))
-- 
2.53.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.