]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Add AutoRebootTimeout configuration
authorOwen Smith <owen.smith@citrix.com>
Thu, 28 Jan 2021 11:51:20 +0000 (11:51 +0000)
committerPaul Durrant <pdurrant@amazon.com>
Sat, 30 Jan 2021 12:14:45 +0000 (12:14 +0000)
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@citrix.com>
src/monitor/monitor.c

index 7d8689f5f3c75cab995849055ec7e8c36b89d838..9adfb79ad68deb05a67aa700bd0df756ee018eb9 100644 (file)
@@ -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);