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

[PATCH xenbus 11/11] Remove the 'Success' field from SUSPEND_CONTEXT



From: Paul Durrant <pdurrant@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 src/xenbus/suspend.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/xenbus/suspend.c b/src/xenbus/suspend.c
index 3dca5d6fe11c..9294ff72f38e 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");
 
-- 
2.17.1




 


Rackspace

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