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

[PATCH xenbus 3/4] Tolerate any failure of __FdoVirqCreate() in the VIRQ_TIMER case



From: Paul Durrant <pdurrant@xxxxxxxxxx>

In pratice __FdoVirqCreate() won't return STATUS_NOT_SUPPORTED since the
XENBUS_EVTCHN(Open, ...) doesn't return a status code and ERRNO_TO_STATUS()
(inside VcpuSetPeriodicTimer()) doesn't translate any Xen errno to that
status code, therefore the check in FdoVirqInitialize() is actually bogus.

This patch simply tolerates any status code returned by __FdoVirqCreate()
when creating a VIRQ_TIMER and then gates enabling the watchdog on there
being at least one VIRQ_TIMER successfully created.

Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>
---
 src/xenbus/fdo.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index 18f936baae38..9db968de0247 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -2978,6 +2978,7 @@ FdoVirqInitialize(
     PXENBUS_VIRQ    Virq;
     ULONG           Count;
     ULONG           Index;
+    ULONG           Timer;
     NTSTATUS        status;
 
     InitializeListHead(&Fdo->VirqList);
@@ -2994,28 +2995,25 @@ FdoVirqInitialize(
 
     Count = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
 
+    Timer = 0;
     for (Index = 0; Index < Count; Index++) {
         status = __FdoVirqCreate(Fdo, VIRQ_TIMER, Index, &Virq);
-        if (!NT_SUCCESS(status)) {
-            if (status != STATUS_NOT_SUPPORTED )
-                continue;
-
-            goto fail2;
-        }
+        if (!NT_SUCCESS(status))
+            continue;
 
         InsertTailList(&Fdo->VirqList, &Virq->ListEntry);
+        Timer++;
     }
 
-    status = SystemSetWatchdog(Fdo->Watchdog);
-    if (!NT_SUCCESS(status))
-        goto fail3;
+    if (Timer != 0) {
+        status = SystemSetWatchdog(Fdo->Watchdog);
+        if (!NT_SUCCESS(status))
+            goto fail2;
+    }
 
 done:
     return STATUS_SUCCESS;
 
-fail3:
-    Error("fail3\n");
-
 fail2:
     Error("fail2\n");
 
-- 
2.17.1




 


Rackspace

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