|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [XENVIF PATCH] Early-stop state wait when backend disappears
During VIF unplug, if the backend disappears before FrontendWaitFor-
BackendXenbusStateChange 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.
Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
src/xenvif/frontend.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index c497f24..daeab9c 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1404,7 +1404,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.51.0.windows.1
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 |