Skip to content

Commit

Permalink
RedfishClientPkg: warn user about reboot if allowed.
Browse files Browse the repository at this point in the history
Warn user about system reboot only if it has not been rejected by
callbacks executed as result of EdkiiRedfishPhaseBeforeReboot notification

Cc: Abner Chang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Signed-off-by: Mike Maslenkin <[email protected]>
Reviewed-by: Nickle Wang <[email protected]>
  • Loading branch information
ghbaccount committed Dec 5, 2023
1 parent 25ad666 commit dc8ac31
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 ();
Expand Down

0 comments on commit dc8ac31

Please sign in to comment.