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

[PATCH] Add AutoRebootTimeout configuration


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Thu, 28 Jan 2021 11:51:20 +0000
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Thu, 28 Jan 2021 11:51:44 +0000
  • Ironport-sdr: yN7enZaJx5VkjW1m155v8/L9C96VNLUZTujWyQOHK6KYlhhB9wQ9S0m/Z3/7iDS2tGquYUbL2g 2f5DmktWyWVeHBIsNW//nOqrGuaxUcRyFhKTqUid+x2KkCO0Ktmrr0fL6RqzhZM/ihp0o74P47 mxN1DUXAOyeH/SgdEtVoehoP0NL9jGiM5mGwCEZvMKyNnK/hpXpZRNfQHg2FtiCdwGvXfvZIBV k8lE65Rj48rTiAZLcHUIPKMjaUoOm//uYtucGnEmtPplTUfk+UagvekFfaYrK4+n2WtSHtxPTf LPo=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Add registry value AutoRebootTimeout, which if set, is used as the
Timeout value passed to InitiateSystemShutdownEx. If not set, use the
default value of 60 seconds.

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/monitor/monitor.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 7d8689f..9adfb79 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -463,6 +463,7 @@ TryAutoReboot(
     DWORD               AutoReboot;
     DWORD               RebootCount;
     DWORD               Length;
+    DWORD               Timeout;
     PTCHAR              DisplayName;
     PTCHAR              Description;
     PTCHAR              Text;
@@ -516,6 +517,16 @@ TryAutoReboot(
 
     Context->RebootPending = TRUE;
 
+    Error = RegQueryValueEx(Context->ParametersKey,
+                            "AutoRebootTimeout",
+                            NULL,
+                            &Type,
+                            (LPBYTE)&Timeout,
+                            &Length);
+    if (Error != ERROR_SUCCESS ||
+        Type != REG_DWORD)
+        Timeout = 60;
+
     DisplayName = GetDisplayName(DriverName);
     if (DisplayName == NULL)
         goto fail1;
@@ -544,7 +555,7 @@ TryAutoReboot(
 
     free(DisplayName);
 
-    DoReboot(Text, 60);
+    DoReboot(Text, Timeout);
 
     free(Text);
 
-- 
2.28.0.windows.1




 


Rackspace

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