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

Signed-off-by: Mike Maslenkin <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Nickle Wang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
  • Loading branch information
ghbaccount committed Nov 30, 2023
1 parent 61443bb commit d439ab9
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 d439ab9

Please sign in to comment.