]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/HiiDB: Record fail info if fail to save data for EfiVarStore
authorDandan Bi <dandan.bi@intel.com>
Mon, 20 Jun 2016 10:24:34 +0000 (18:24 +0800)
committerStar Zeng <star.zeng@intel.com>
Thu, 7 Jul 2016 04:46:39 +0000 (12:46 +0800)
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>
MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c

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