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

RE: [PATCH] Add AutoRebootTimeout configuration



> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of 
> Owen Smith
> Sent: 28 January 2021 11:51
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Owen Smith <owen.smith@xxxxxxxxxx>
> Subject: [PATCH] Add AutoRebootTimeout configuration
> 
> 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>

Reviewed-by: Paul Durrant <paul@xxxxxxx>

> ---
>  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®.