Reviewed-by: Nickle Wang <nick...@nvidia.com>

Regards,
Nickle

> -----Original Message-----
> From: Mike Maslenkin <mike.maslen...@gmail.com>
> Sent: Friday, December 1, 2023 7:19 AM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang <nick...@nvidia.com>;
> ig...@ami.com
> Subject: [PATCH 3/3] RedfishClientPkg: warn user about reboot if allowed.
> 
> External email: Use caution opening links or attachments
> 
> 
> Warn user about system reboot only if it has not been rejected by callbacks
> executed as result of EdkiiRedfishPhaseBeforeReboot notification
> 
> Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com>
> Cc: Abner Chang <abner.ch...@amd.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> ---
>  .../RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c      | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
> b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
> index 51d0387ce867..f3188ddfde2c 100644
> --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
> +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
> @@ -296,9 +296,6 @@ RedfishFeatureDriverStartup (
>    // If system configuration is changed, reboot system.
>    //
>    if (PcdGetBool (PcdRedfishSystemRebootRequired)) {
> -    Print (L"System configuration is changed from RESTful interface. Reboot
> system in %d seconds...\n", RebootTimeout);
> -    gBS->Stall (RebootTimeout * 1000000U);
> -
>      //
>      // Call override protocol to notify platform that Redfish is processed
>      // and about to reboot system.
> @@ -312,9 +309,14 @@ RedfishFeatureDriverStartup (
>        Status = RedfishOverride->NotifyPhase (RedfishOverride,
> EdkiiRedfishPhaseBeforeReboot);
>        if (EFI_ERROR (Status)) {
>          DEBUG ((DEBUG_ERROR, "%a: abort the reboot because NotifyPhase()
> returns failure: %r\n", __func__, Status));
> -        return;
> +        PcdSetBoolS (PcdRedfishSystemRebootRequired, FALSE);
>        }
>      }
> +  }
> +
> +  if (PcdGetBool (PcdRedfishSystemRebootRequired)) {
> +    Print (L"System configuration is changed from RESTful interface. Reboot
> system in %d seconds...\n", RebootTimeout);
> +    gBS->Stall (RebootTimeout * 1000000U);
> 
>      gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
>      CpuDeadLoop ();
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112006): https://edk2.groups.io/g/devel/message/112006
Mute This Topic: https://groups.io/mt/102905312/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to