From 087e65a76c3c187ded4f3d1774fee97897a53454 Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Tue, 31 Oct 2023 15:09:07 +0800 Subject: [PATCH] RedfishClientPkg/RedfishFeatureUtilityLib: fix issues and enhancement -Add RedfishDebugLib to print Redfish request and response details when PATCH and POST request return error. -Use "%a:" in debug print to align with the style in EDK2. -Enhance GetConfigureLang() to handle pending resource URI. Pending resource share ths same schema as its active resource. So we can simply remove "/Settings" from URI and search again. -Enhancement to GetPropertyVagueValue(). This function stops to handle remaining property while error happens. We like to process as much as properties as we can and skip the problematic property. -Enhancement to MatchPropertyWithJsonContext(). For string type of BIOS attribute, it is possible that the attribute value is empty by default. This does not means that the resource is not provisioned yet. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../RedfishFeatureUtilityInternal.h | 2 + .../RedfishFeatureUtilityLib.c | 229 ++++++++++-------- .../RedfishFeatureUtilityLib.inf | 1 + RedfishClientPkg/RedfishClientLibs.dsc.inc | 1 + 4 files changed, 133 insertions(+), 100 deletions(-) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h index d2bd65078..5d39984c0 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h @@ -2,6 +2,7 @@ Common header file for RedfishFeatureUtilityLib driver. (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -28,6 +29,7 @@ #include #include #include +#include #include diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c index 1e5c3f110..2b35cbd42 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c @@ -133,7 +133,7 @@ SetEtagWithUri ( Status = RedfishLocateProtocol ((VOID **)&mEtagProtocol, &gEdkIIRedfishETagProtocolGuid); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, fail to locate gEdkIIRedfishETagProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: fail to locate gEdkIIRedfishETagProtocolGuid: %r\n", __func__, Status)); return Status; } @@ -175,7 +175,7 @@ GetEtagWithUri ( Status = RedfishLocateProtocol ((VOID **)&mEtagProtocol, &gEdkIIRedfishETagProtocolGuid); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, fail to locate gEdkIIRedfishETagProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: fail to locate gEdkIIRedfishETagProtocolGuid: %r\n", __func__, Status)); return NULL; } @@ -306,10 +306,10 @@ ApplyFeatureSettingsStringType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeString) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -317,7 +317,7 @@ ApplyFeatureSettingsStringType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Buffer, FeatureValue)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Buffer, FeatureValue)); FreePool (RedfishValue.Value.Buffer); RedfishValue.Value.Buffer = FeatureValue; @@ -329,10 +329,10 @@ ApplyFeatureSettingsStringType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s to %s failed: %r\n", __func__, ConfigureLang, FeatureValue, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s to %s failed: %r\n", __func__, ConfigureLang, FeatureValue, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %s\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Buffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is: %s\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Buffer, Status)); } } @@ -372,10 +372,10 @@ ApplyFeatureSettingsNumericType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeInteger) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not numeric type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not numeric type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -383,7 +383,7 @@ ApplyFeatureSettingsNumericType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s from 0x%x to 0x%x\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Integer, FeatureValue)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s from 0x%x to 0x%x\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Integer, FeatureValue)); RedfishValue.Value.Integer = (INT64)FeatureValue; @@ -394,10 +394,10 @@ ApplyFeatureSettingsNumericType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", __func__, ConfigureLang, FeatureValue, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s to 0x%x failed: %r\n", __func__, ConfigureLang, FeatureValue, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: 0x%x\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Integer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is: 0x%x\n", __func__, Schema, Version, ConfigureLang, RedfishValue.Value.Integer, Status)); } } @@ -437,10 +437,10 @@ ApplyFeatureSettingsBooleanType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeBoolean) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not boolean type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not boolean type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -448,7 +448,7 @@ ApplyFeatureSettingsBooleanType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"), (FeatureValue ? "True" : "False"))); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"), (FeatureValue ? "True" : "False"))); RedfishValue.Value.Boolean = FeatureValue; @@ -459,10 +459,10 @@ ApplyFeatureSettingsBooleanType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __func__, ConfigureLang, (FeatureValue ? "True" : "False"), Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s to %a failed: %r\n", __func__, ConfigureLang, (FeatureValue ? "True" : "False"), Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"), Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureLang, (RedfishValue.Value.Boolean ? "True" : "False"), Status)); } } @@ -508,13 +508,13 @@ ApplyFeatureSettingsVagueType ( ConfigureLangAscii = AllocatePool (StrLen (ConfigureLang) + 1); if (ConfigureLangAscii == NULL) { Status = EFI_OUT_OF_RESOURCES; - DEBUG ((DEBUG_ERROR, "%a, Allocate memory for generate ConfigureLang of vague key of %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: Allocate memory for generate ConfigureLang of vague key of %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); return Status; } Status = UnicodeStrToAsciiStrS (ConfigureLang, ConfigureLangAscii, StrLen (ConfigureLang) + 1); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, Convert the configureLang of vague key of %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: Convert the configureLang of vague key of %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); return Status; } @@ -528,7 +528,7 @@ ApplyFeatureSettingsVagueType ( ConfigureLangKeyAscii = AllocateZeroPool (StrSize); ConfigureKeyLang = AllocateZeroPool (StrSize * sizeof (CHAR16)); if ((ConfigureLangKeyAscii == NULL) || (ConfigureKeyLang == NULL)) { - DEBUG ((DEBUG_ERROR, "%a, Generate ConfigureLang of vague key of %a.%a %s %a failed!\n", __func__, Schema, Version, ConfigureLang, CurrentVagueValuePtr->KeyNamePtr)); + DEBUG ((DEBUG_ERROR, "%a: Generate ConfigureLang of vague key of %a.%a %s %a failed!\n", __func__, Schema, Version, ConfigureLang, CurrentVagueValuePtr->KeyNamePtr)); goto ErrorContinue; } @@ -548,7 +548,7 @@ ApplyFeatureSettingsVagueType ( } else if (CurrentVagueValuePtr->Value->DataType == RedfishCS_Vague_DataType_Int64) { PropertyDatatype = RedfishValueTypeInteger; } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property data type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s Unsupported Redfish property data type\n", __func__, Schema, Version, ConfigureLang)); goto ErrorContinue; } @@ -557,10 +557,10 @@ ApplyFeatureSettingsVagueType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureKeyLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureKeyLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureKeyLang, Status)); } else { if (RedfishValue.Type != PropertyDatatype) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s mismatched data type\n", __func__, Schema, Version, ConfigureKeyLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s mismatched data type\n", __func__, Schema, Version, ConfigureKeyLang)); goto ErrorContinue; } @@ -572,7 +572,7 @@ ApplyFeatureSettingsVagueType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer, CurrentVagueValuePtr->Value->DataValue.CharPtr)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s from %a to %a\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer, CurrentVagueValuePtr->Value->DataValue.CharPtr)); FreePool (RedfishValue.Value.Buffer); RedfishValue.Value.Buffer = CurrentVagueValuePtr->Value->DataValue.CharPtr; Status = RedfishPlatformConfigSetValue (Schema, Version, ConfigureKeyLang, RedfishValue); @@ -582,10 +582,10 @@ ApplyFeatureSettingsVagueType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %a to %a failed: %r\n", __func__, ConfigureKeyLang, CurrentVagueValuePtr->Value->DataValue.CharPtr, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %a to %a failed: %r\n", __func__, ConfigureKeyLang, CurrentVagueValuePtr->Value->DataValue.CharPtr, Status)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer, Status)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Buffer, Status)); } } else if (PropertyDatatype == RedfishValueTypeBoolean) { // @@ -597,7 +597,7 @@ ApplyFeatureSettingsVagueType ( // DEBUG (( DEBUG_MANAGEABILITY, - "%a, %a.%a apply %s from %a to %a\n", + "%a: %a.%a apply %s from %a to %a\n", __func__, Schema, Version, @@ -614,10 +614,10 @@ ApplyFeatureSettingsVagueType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n", __func__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value->DataValue.BoolPtr ? "True" : "False"), Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s to %a failed: %r\n", __func__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value->DataValue.BoolPtr ? "True" : "False"), Status)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureKeyLang, (RedfishValue.Value.Boolean ? "True" : "False"), Status)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a %s value is: %a\n", __func__, Schema, Version, ConfigureKeyLang, (RedfishValue.Value.Boolean ? "True" : "False"), Status)); } } else if (PropertyDatatype == RedfishValueTypeInteger) { // @@ -627,7 +627,7 @@ ApplyFeatureSettingsVagueType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s from 0x%x to 0x%x\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer, *CurrentVagueValuePtr->Value->DataValue.Int64Ptr)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s from 0x%x to 0x%x\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer, *CurrentVagueValuePtr->Value->DataValue.Int64Ptr)); RedfishValue.Value.Integer = (INT64)*CurrentVagueValuePtr->Value->DataValue.Int64Ptr; Status = RedfishPlatformConfigSetValue (Schema, Version, ConfigureKeyLang, RedfishValue); @@ -637,13 +637,13 @@ ApplyFeatureSettingsVagueType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n", __func__, ConfigureKeyLang, *CurrentVagueValuePtr->Value->DataValue.Int64Ptr, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s to 0x%x failed: %r\n", __func__, ConfigureKeyLang, *CurrentVagueValuePtr->Value->DataValue.Int64Ptr, Status)); } } else { - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a %s value is: 0x%x\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer, Status)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a %s value is: 0x%x\n", __func__, Schema, Version, ConfigureKeyLang, RedfishValue.Value.Integer, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s Unsupported Redfish property data type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s Unsupported Redfish property data type\n", __func__, Schema, Version, ConfigureLang)); goto ErrorContinue; } } @@ -761,10 +761,10 @@ ApplyFeatureSettingsStringArrayType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeStringArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -775,7 +775,7 @@ ApplyFeatureSettingsStringArrayType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); FreeArrayTypeRedfishValue (&RedfishValue); // @@ -819,10 +819,10 @@ ApplyFeatureSettingsStringArrayType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s array failed: %r\n", __func__, ConfigureLang, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); } } @@ -864,10 +864,10 @@ ApplyFeatureSettingsNumericArrayType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeIntegerArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -878,7 +878,7 @@ ApplyFeatureSettingsNumericArrayType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); FreeArrayTypeRedfishValue (&RedfishValue); // @@ -917,10 +917,10 @@ ApplyFeatureSettingsNumericArrayType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s array failed: %r\n", __func__, ConfigureLang, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); } } @@ -962,10 +962,10 @@ ApplyFeatureSettingsBooleanArrayType ( // Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLang, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s failed: %r\n", __func__, Schema, Version, ConfigureLang, Status)); } else { if (RedfishValue.Type != RedfishValueTypeBooleanArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return EFI_DEVICE_ERROR; } @@ -976,7 +976,7 @@ ApplyFeatureSettingsBooleanArrayType ( // // Apply settings from redfish // - DEBUG ((DEBUG_MANAGEABILITY, "%a, %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: %a.%a apply %s for array\n", __func__, Schema, Version, ConfigureLang)); FreeArrayTypeRedfishValue (&RedfishValue); // @@ -1015,10 +1015,10 @@ ApplyFeatureSettingsBooleanArrayType ( // REDFISH_ENABLE_SYSTEM_REBOOT (); } else { - DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply %s array failed: %r\n", __func__, ConfigureLang, Status)); } } else { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s array value has no change\n", __func__, Schema, Version, ConfigureLang)); } } @@ -1065,7 +1065,7 @@ GetResourceByUri ( Response ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishGetByUri to %a failed: %r\n", __func__, AsciiResourceUri, Status)); + DEBUG ((DEBUG_ERROR, "%a: RedfishGetByUri to %a failed: %r\n", __func__, AsciiResourceUri, Status)); if (Response->Payload != NULL) { RedfishDumpPayload (Response->Payload); RedfishFreeResponse ( @@ -1344,7 +1344,7 @@ CopyConfiglanguageList ( DestConfigureLangList->List = (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *)AllocateZeroPool (sizeof (REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG) * DestConfigureLangList->Count); if (DestConfigureLangList->List == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG.\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG.\n", __func__)); return EFI_OUT_OF_RESOURCES; } @@ -1503,7 +1503,7 @@ SetResourceConfigLangMemberInstance ( if (MaxtLengthConfigLang < MaxStrLength) { NewConfigLang = (EFI_STRING)AllocateZeroPool (MaxStrLength); if (NewConfigLang == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Fail to allocate memory for NewConfigLang.\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for NewConfigLang.\n", __func__)); return EFI_OUT_OF_RESOURCES; } } @@ -1586,7 +1586,7 @@ RedfishFeatureGetUnifiedArrayTypeConfigureLang ( Status = RedfishPlatformConfigGetConfigureLang (Schema, Version, Pattern, &ConfigureLangList, &Count); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishFeatureGetConfigureLangRegex failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetConfigureLangRegex failed: %r\n", __func__, Status)); return Status; } @@ -1800,6 +1800,13 @@ CreatePayloadToPatchResource ( Status = RedfishPatchToPayload (TargetPayload, Payload, &PostResponse); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a:%d Failed to PATCH payload to Redfish service.\n", __func__, __LINE__)); + + DEBUG_CODE_BEGIN (); + DEBUG ((DEBUG_ERROR, "%a: Request:\n", __func__)); + DumpRedfishPayload (DEBUG_ERROR, Payload); + DEBUG ((DEBUG_ERROR, "%a: Response:\n", __func__)); + DumpRedfishResponse (__func__, DEBUG_ERROR, &PostResponse); + DEBUG_CODE_END (); goto EXIT_FREE_JSON_VALUE; } @@ -1871,7 +1878,15 @@ CreatePayloadToPostResource ( ZeroMem (&PostResponse, sizeof (REDFISH_RESPONSE)); Status = RedfishPostToPayload (TargetPayload, Payload, &PostResponse); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a:%d Failed to POST Attribute Registry to Redfish service.\n", __func__, __LINE__)); + DEBUG ((DEBUG_ERROR, "%a:%d Failed to POST payload to Redfish service.\n", __func__, __LINE__)); + + DEBUG_CODE_BEGIN (); + DEBUG ((DEBUG_ERROR, "%a: Request:\n", __func__)); + DumpRedfishPayload (DEBUG_ERROR, Payload); + DEBUG ((DEBUG_ERROR, "%a: Response:\n", __func__)); + DumpRedfishResponse (__func__, DEBUG_ERROR, &PostResponse); + DEBUG_CODE_END (); + goto EXIT_FREE_JSON_VALUE; } @@ -1926,11 +1941,11 @@ RedfishGetUri ( Status = RedfishLocateProtocol ((VOID **)&mConfigLangMapProtocol, &gEdkIIRedfishConfigLangMapProtocolGuid); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); return NULL; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, Get: %s\n", __func__, ConfigLang)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: Get: %s\n", __func__, ConfigLang)); CloseBracket = StrStr (ConfigLang, L"{"); if (CloseBracket == NULL) { @@ -1971,7 +1986,7 @@ RedfishGetUri ( // Invalid format. No '}' found // if (*Target == '\0') { - DEBUG ((DEBUG_ERROR, "%a, invalid format: %s\n", __func__, ConfigLang)); + DEBUG ((DEBUG_ERROR, "%a: invalid format: %s\n", __func__, ConfigLang)); return NULL; } @@ -1995,11 +2010,11 @@ RedfishGetUri ( &Found ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, Can not find: %s\n", __func__, TempStr)); + DEBUG ((DEBUG_ERROR, "%a: Can not find: %s\n", __func__, TempStr)); return NULL; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, Found: %s\n", __func__, Found)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: Found: %s\n", __func__, Found)); // // Keep result in final string pool @@ -2021,7 +2036,7 @@ RedfishGetUri ( StrCatS (ResultStr, MAX_REDFISH_URL_LEN, Head); } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, return: %s\n", __func__, ResultStr)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: return: %s\n", __func__, ResultStr)); return ResultStr; } @@ -2048,11 +2063,11 @@ RedfishGetConfigLanguage ( return NULL; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, search config lang for URI: %s\n", __func__, Uri)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: search config lang for URI: %s\n", __func__, Uri)); Status = RedfishLocateProtocol ((VOID **)&mConfigLangMapProtocol, &gEdkIIRedfishConfigLangMapProtocolGuid); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); return NULL; } @@ -2089,6 +2104,7 @@ GetConfigureLang ( EFI_STRING ResultStr; EFI_STRING UnicodeUri; EFI_STATUS Status; + EFI_STRING StrFound; if (IS_EMPTY_STRING (Uri)) { return NULL; @@ -2107,7 +2123,20 @@ GetConfigureLang ( ConfigLang = RedfishGetConfigLanguage (UnicodeUri); if (ConfigLang == NULL) { - return NULL; + // + // @Redfish.Settings share the same schema as its parent. + // Remove "Settings" and try again. + // + StrFound = StrStr (UnicodeUri, L"/Settings"); + if (StrFound != NULL) { + StrFound[0] = L'\0'; + DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try: %s\n", __FUNCTION__, UnicodeUri)); + ConfigLang = RedfishGetConfigLanguage (UnicodeUri); + } + + if (ConfigLang == NULL) { + return NULL; + } } if (IS_EMPTY_STRING (PropertyName)) { @@ -2150,11 +2179,11 @@ RedfisSetRedfishUri ( Status = RedfishLocateProtocol ((VOID **)&mConfigLangMapProtocol, &gEdkIIRedfishConfigLangMapProtocolGuid); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: fail to locate gEdkIIRedfishConfigLangMapProtocolGuid: %r\n", __func__, Status)); return Status; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, Saved: %s -> %s\n", __func__, ConfigLang, Uri)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: Saved: %s -> %s\n", __func__, ConfigLang, Uri)); return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang, Uri); } @@ -2295,12 +2324,12 @@ GetPropertyStringValue ( UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeString) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } @@ -2353,12 +2382,12 @@ GetPropertyNumericValue ( UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeInteger) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not numeric type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not numeric type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } @@ -2415,12 +2444,12 @@ GetPropertyBooleanValue ( UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeBoolean) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not boolean type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not boolean type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } @@ -2509,25 +2538,25 @@ GetPropertyStringArrayValue ( BufferSize = sizeof (CHAR16) * MAX_CONF_LANG_LEN; ConfigureLangBuffer = AllocatePool (BufferSize); if (ConfigureLangBuffer == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeStringArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } StringArray = AllocatePool (sizeof (CHAR8 *) * RedfishValue.ArrayCount); if (StringArray == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } @@ -2580,25 +2609,25 @@ GetPropertyNumericArrayValue ( BufferSize = sizeof (CHAR16) * MAX_CONF_LANG_LEN; ConfigureLangBuffer = AllocatePool (BufferSize); if (ConfigureLangBuffer == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeIntegerArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } IntegerArray = AllocatePool (sizeof (INT64) * RedfishValue.ArrayCount); if (IntegerArray == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } @@ -2651,25 +2680,25 @@ GetPropertyBooleanArrayValue ( BufferSize = sizeof (CHAR16) * MAX_CONF_LANG_LEN; ConfigureLangBuffer = AllocatePool (BufferSize); if (ConfigureLangBuffer == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } UnicodeSPrint (ConfigureLangBuffer, BufferSize, L"%s/%s", ConfigureLang, PropertyName); Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangBuffer, &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); return NULL; } if (RedfishValue.Type != RedfishValueTypeBooleanArray) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a %s value is not string array type\n", __func__, Schema, Version, ConfigureLang)); return NULL; } BooleanArray = AllocatePool (sizeof (INT64) * RedfishValue.ArrayCount); if (BooleanArray == NULL) { - DEBUG ((DEBUG_ERROR, "%a, out of resource\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: out of resource\n", __func__)); return NULL; } @@ -2740,19 +2769,19 @@ NewEmptyPropKeyValueFromRedfishValue ( KeyNameChar = StrUnicodeToAscii (KeyName); if (KeyNameChar == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to convert unicode to ASCII.\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to convert unicode to ASCII.\n", __func__)); return NULL; } EmptyPropKeyValue = (RedfishCS_EmptyProp_KeyValue *)AllocateZeroPool (sizeof (RedfishCS_EmptyProp_KeyValue)); if (EmptyPropKeyValue == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for EmptyPropKeyValue\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for EmptyPropKeyValue\n", __func__)); return NULL; } VagueValue = (RedfishCS_Vague *)AllocateZeroPool (sizeof (RedfishCS_Vague)); if (VagueValue == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for VagueValue\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for VagueValue\n", __func__)); FreePool (EmptyPropKeyValue); return NULL; } @@ -2775,7 +2804,7 @@ NewEmptyPropKeyValueFromRedfishValue ( DataSize = AsciiStrSize (RedfishValue->Value.Buffer); Data = (VOID *)RedfishValue->Value.Buffer; } else { - DEBUG ((DEBUG_ERROR, "%a, wrong type of RedfishValue: %x\n", __func__, RedfishValue->Type)); + DEBUG ((DEBUG_ERROR, "%a: wrong type of RedfishValue: %x\n", __func__, RedfishValue->Type)); FreePool (VagueValue); FreePool (EmptyPropKeyValue); return NULL; @@ -2822,18 +2851,21 @@ GetPropertyVagueValue ( UINTN BufferSize; UINTN ConfigListCount; UINTN ConfigListCountIndex; + UINTN ListCount; if (IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) || IS_EMPTY_STRING (ConfigureLang) || IS_EMPTY_STRING (PropertyName)) { return NULL; } + ListCount = 0; + FirstEmptyPropKeyValueList = 0; // // Configure Language buffer. // BufferSize = sizeof (CHAR16) * MAX_CONF_LANG_LEN; ConfigureLangBuffer = AllocatePool (BufferSize); if (ConfigureLangBuffer == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for ConfigureLangBuffer\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for ConfigureLangBuffer\n", __func__)); return NULL; } @@ -2845,7 +2877,7 @@ GetPropertyVagueValue ( BufferSize = (StrLen (ConfigureLangBuffer) + StrLen (L"/.*") + 1) * sizeof (CHAR16); // Increase one for the NULL terminator. SearchPattern = AllocatePool (BufferSize); if (SearchPattern == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to allocate memory for SearchPattern\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate memory for SearchPattern\n", __func__)); FreePool (ConfigureLangBuffer); return NULL; } @@ -2855,21 +2887,23 @@ GetPropertyVagueValue ( StrCatS (SearchPattern, BufferSize, L"/.*"); Status = RedfishPlatformConfigGetConfigureLang (Schema, Version, SearchPattern, &ConfigureLangList, &ConfigListCount); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a Get configure language of vague type values of %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); + DEBUG ((DEBUG_ERROR, "%a: %a.%a Get configure language of vague type values of %s failed: %r\n", __func__, Schema, Version, ConfigureLangBuffer, Status)); goto ErrorLeave; } // // Build up the list of RedfishCS_EmptyProp_KeyValue. // + ListCount = 0; ConfigListCountIndex = 0; PreEmptyPropKeyValueList = NULL; FirstEmptyPropKeyValueList = NULL; while (ConfigListCountIndex < ConfigListCount) { Status = RedfishPlatformConfigGetValue (Schema, Version, ConfigureLangList[ConfigListCountIndex], &RedfishValue); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangList[ConfigListCountIndex], Status)); - goto ErrorLeave; + DEBUG ((DEBUG_ERROR, "%a: %a.%a query current setting for %s failed: %r\n", __func__, Schema, Version, ConfigureLangList[ConfigListCountIndex], Status)); + ConfigListCountIndex++; + continue; } // @@ -2881,7 +2915,7 @@ GetPropertyVagueValue ( // EmptyPropKeyValueList = NewEmptyPropKeyValueFromRedfishValue (KeyName, &RedfishValue); if (EmptyPropKeyValueList == NULL) { - DEBUG ((DEBUG_ERROR, "%a, Failed to create an entry of EmptyPropKeyValueList\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to create an entry of EmptyPropKeyValueList\n", __func__)); ConfigListCountIndex++; continue; } @@ -2897,6 +2931,7 @@ GetPropertyVagueValue ( PreEmptyPropKeyValueList = EmptyPropKeyValueList; ConfigListCountIndex++; + ListCount++; } goto LeaveFunction; @@ -2919,7 +2954,7 @@ ErrorLeave:; FreePool (ConfigureLangList); - *NumberOfValues = (UINT32)ConfigListCount; + *NumberOfValues = (UINT32)ListCount; return FirstEmptyPropKeyValueList; } @@ -2986,7 +3021,7 @@ CheckEtag ( EtagInDb = NULL; EtagInDb = GetEtagWithUri (Uri); if (EtagInDb == NULL) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, no ETAG record cound be found for: %s\n", __func__, Uri)); + DEBUG ((REDFISH_DEBUG_TRACE, "%a: no ETAG record cound be found for: %s\n", __func__, Uri)); return FALSE; } @@ -3129,12 +3164,6 @@ MatchPropertyWithJsonContext ( MatchObj = NULL; } - break; - case EdkiiJsonTypeString: - if (IS_EMPTY_STRING (JsonValueGetString (MatchObj))) { - MatchObj = NULL; - } - break; case EdkiiJsonTypeNull: MatchObj = NULL; diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf index 66d5dce6c..fd66b8ac3 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf @@ -45,6 +45,7 @@ UefiRuntimeServicesTableLib PrintLib HttpLib + RedfishDebugLib [Protocols] gEdkIIRedfishETagProtocolGuid ## CONSUMED ## diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/RedfishClientLibs.dsc.inc index 5ea380155..5eae6711a 100644 --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc @@ -39,3 +39,4 @@ RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf + RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf