]> xenbits.xensource.com Git - people/pauldu/xenbus.git/commitdiff
Re-register DbgPrint callback on resume from S4
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 1 Aug 2016 14:09:51 +0000 (15:09 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 1 Aug 2016 14:09:51 +0000 (15:09 +0100)
Windows seems to lose knowledge of the callback when it cycles into and
out of S4 so we need to re-register.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
include/xen.h
src/xen/log.c
src/xenbus/fdo.c

index f03635f52f0e1c9b6a09258f23685b92521f5cd3..c8a8e4c561ebe6823f909010c5c67cb3af2e68e4 100644 (file)
@@ -397,6 +397,12 @@ LogPrintf(
     ...
     );
 
+XEN_API
+VOID
+LogResume(
+    VOID
+    );
+
 // SYSTEM
 
 XEN_API
index f819a7ea027ce9862f67e8c604e5b4e1fa3bc88b..ff8b0918521e9a3c22ba86f81a41346b1fa4a867 100644 (file)
@@ -649,9 +649,25 @@ done:
     return Enable;
 }
 
+XEN_API
+VOID
+LogResume(
+    VOID
+    )
+{
+    PLOG_CONTEXT    Context = &LogContext;
+
+    if (!Context->Enabled)
+        return;
+
+    (VOID) DbgSetDebugPrintCallback(LogDebugPrint, FALSE);
+    (VOID) DbgSetDebugPrintCallback(LogDebugPrint, TRUE);
+}
+
 NTSTATUS
 LogInitialize(
-    VOID)
+    VOID
+    )
 {
     PLOG_CONTEXT    Context = &LogContext;
     ULONG           References;
index ce4d4ac1e3c1b4601c6fbf59887e3ffe50b65ac6..34aee1492907e85177d6cf3c13209b7ce0e2642b 100644 (file)
@@ -3188,6 +3188,8 @@ FdoS4ToS3(
     if (!__FdoIsActive(Fdo))
         goto not_active;
 
+    LogResume();
+
     HypercallPopulate();
 
     UnplugDevices();