Reviewed-by: Chao Zhang <[email protected]>




Thanks & Best regards
Chao Zhang

-----Original Message-----
From: Bi, Dandan 
Sent: Tuesday, July 05, 2016 4:53 PM
To: [email protected]
Cc: Gao, Liming; Dong, Eric; Zhang, Chao B
Subject: [patch] 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 <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Chao Zhang <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Eric Dong <[email protected]>
---
 MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c 
b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index 106f25d..0578352 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -4058,10 +4058,11 @@ RouteConfigRespForEfiVarStore (
 
   Status       = EFI_SUCCESS;
   BufferSize   = 0;
   VarStore     = NULL;
   VarStoreName = NULL;
+  *Result = RequestResp;
 
   NameSize = AsciiStrSize ((CHAR8 *)EfiVarStoreInfo->Name);
   VarStoreName = AllocateZeroPool (NameSize * sizeof (CHAR16));
   if (VarStoreName == NULL) {
     Status = EFI_OUT_OF_RESOURCES;
@@ -4069,10 +4070,11 @@ RouteConfigRespForEfiVarStore (
   }
   AsciiStrToUnicodeStrS ((CHAR8 *) EfiVarStoreInfo->Name, VarStoreName, 
NameSize);
       
   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;
   }
 
   BlockSize = BufferSize;
   VarStore = AllocateZeroPool (BufferSize);
@@ -4087,10 +4089,11 @@ RouteConfigRespForEfiVarStore (
     goto Done;
   }
 
   Status = gRT->SetVariable (VarStoreName, &EfiVarStoreInfo->Guid, 
EfiVarStoreInfo->Attributes, BufferSize, VarStore);
   if (EFI_ERROR (Status)) {
+    *Result = RequestResp;
     goto Done;
   }
 
 Done:
   if (VarStoreName != NULL) {
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to