]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Remove the 'Success' field from SUSPEND_CONTEXT
authorPaul Durrant <pdurrant@amazon.com>
Fri, 6 May 2022 11:03:58 +0000 (12:03 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Fri, 6 May 2022 12:49:13 +0000 (13:49 +0100)
Now that there are dedicated SyncRunEarly() and SyncRunLate() functions there
is no need for this value; we can simply make the function invocations
contingent on the success of the hypercall (which tells us whether we are
doing fast-resume or not).

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
src/xenbus/suspend.c

index 3dca5d6fe11c9255bc2b61d1f7e68f7c19e39c46..9294ff72f38e4f052c5ef8d2981fcee7b5889a9c 100644 (file)
@@ -51,7 +51,6 @@ struct _XENBUS_SUSPEND_CONTEXT {
     PXENBUS_FDO                 Fdo;
     KSPIN_LOCK                  Lock;
     LONG                        References;
-    BOOLEAN                     Success;
     ULONG                       Count;
     LIST_ENTRY                  EarlyList;
     LIST_ENTRY                  LateList;
@@ -193,9 +192,6 @@ SuspendEarly(
     LogPrintf(LOG_LEVEL_INFO,
               "SUSPEND: EARLY (%u)\n", Cpu);
 
-    if (!Context->Success)
-        return;
-
     //
     // No lock is required here as the VM is single-threaded with interrupts
     // disabled.
@@ -236,7 +232,7 @@ SuspendLate(
     LogPrintf(LOG_LEVEL_INFO,
               "SUSPEND: LATE (%u)\n", Cpu);
 
-    if (!Context->Success || Cpu != 0)
+    if (Cpu != 0)
         return;
 
     // No lock is required here as the VM is single-threaded
@@ -282,14 +278,15 @@ SuspendTrigger(
 
     __SuspendLogTimers("POST-SUSPEND");
 
-    Context->Success = NT_SUCCESS(status) ? TRUE : FALSE;
+    if (NT_SUCCESS(status))
+        SyncRunEarly();
 
-    SyncRunEarly();
     SyncEnableInterrupts();
-    SyncRunLate();
-    SyncRelease();
 
-    Context->Success = FALSE;
+    if (NT_SUCCESS(status))
+        SyncRunLate();
+
+    SyncRelease();
 
     LogPrintf(LOG_LEVEL_INFO, "SUSPEND: <====\n");