MdeModulePkg/HiiDB: Record fail info if fail to save data for EfiVarStore

HiiConfigRoutingRouteConfig function returns 'Progress' to indicate
the failure info in the ConfigResp string. But when fail to route the
ConfigResp for EfiVarStore, it doesn't return the correct failure info.
Now this patch is to fix this issue and add debug info let user know the
reason of failure.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
This commit is contained in:
Dandan Bi 2016-06-20 18:24:34 +08:00 committed by Star Zeng
parent 3a986a353d
commit 237e849da4
1 changed files with 3 additions and 0 deletions

View File

@ -4060,6 +4060,7 @@ RouteConfigRespForEfiVarStore (
BufferSize = 0;
VarStore = NULL;
VarStoreName = NULL;
*Result = RequestResp;
NameSize = AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name);
VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16));
@ -4071,6 +4072,7 @@ RouteConfigRespForEfiVarStore (
Status = gRT->GetVariable (VarStoreName, &EfiVarStoreInfo->Guid, NULL, &BufferSize, NULL);
if (Status != EFI_BUFFER_TOO_SMALL) {
DEBUG ((DEBUG_ERROR, "The variable does not exist!"));
goto Done;
}
@ -4089,6 +4091,7 @@ RouteConfigRespForEfiVarStore (
Status = gRT->SetVariable (VarStoreName, &EfiVarStoreInfo->Guid, EfiVarStoreInfo->Attributes, BufferSize, VarStore);
if (EFI_ERROR (Status)) {
*Result = RequestResp;
goto Done;
}