From: Paul Durrant Date: Fri, 6 May 2022 11:03:58 +0000 (+0100) Subject: Remove the 'Success' field from SUSPEND_CONTEXT X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8b487fc5826e7d41c702fdc811f31bbadd8a0e64;p=pvdrivers%2Fwin%2Fxenbus.git Remove the 'Success' field from SUSPEND_CONTEXT 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 --- diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c index 3dca5d6..9294ff7 100644 --- a/src/xenbus/suspend.c +++ b/src/xenbus/suspend.c @@ -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");