|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] Early-stop state wait when backend disappears
Reviewed-by: Owen Smith <owen.smith@xxxxxxxxxx>
________________________________________
From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of Tu
Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 16 October 2026 12:43 PM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh
Subject: [PATCH] Early-stop state wait when backend disappears
During unplug, if the backend disappears before FrontendWaitForBackend-
XenbusStateChange is called, that function will block at
XenbusStateUnknown and cause the system to hang until the timeout
expires.
Break out of the watch loop as soon as this condition is detected to
avoid this hang.
Ported from Xenvif.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xenvkbd/frontend.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/xenvkbd/frontend.c b/src/xenvkbd/frontend.c
index 7b258ca..4b96423 100644
--- a/src/xenvkbd/frontend.c
+++ b/src/xenvkbd/frontend.c
@@ -460,7 +460,12 @@ FrontendWaitForBackendXenbusStateChange(
__FrontendGetBackendPath(Frontend),
"state",
&Buffer);
- if (!NT_SUCCESS(status)) {
+ if (status == STATUS_OBJECT_NAME_NOT_FOUND) {
+ *State = XenbusStateUnknown;
+ Trace("%s disappeared\n",
+ __FrontendGetBackendPath(Frontend));
+ break;
+ } else if (!NT_SUCCESS(status)) {
*State = XenbusStateUnknown;
} else {
*State = (XenbusState)strtol(Buffer, NULL, 10);
--
2.55.0.windows.3
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |