:p
atchew
Login
From: Abner Chang <abner.chang@amd.com> Update Redfish ComputerSystem_1_5_0 feature driver to align the implementation with latest code. This driver handles all of ComputerSystem v1_5_0 properties and incorporate with Redfish simualtor. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> --- .../v1_5_0/Dxe/ComputerSystemDxe.inf | 1 + .../v1_5_0/Common/ComputerSystemCommon.c | 347 ++++++++++++------ .../v1_5_0/Dxe/ComputerSystemDxe.c | 64 ++-- 3 files changed, 271 insertions(+), 141 deletions(-) diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentifyLib UefiLib UefiDriverEntryPoint + RedfishAddendumLib RedfishHttpCacheLib [Protocols] diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystem ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, Status)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( // // No change // - DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume action\n", __func__, Private->Uri)); - Status = EFI_ALREADY_STARTED; + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore consume action\n", __func__, Private->Uri)); + Status = EFI_SUCCESS; goto ON_RELEASE; } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootOrder); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideEnabled); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideMode); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->UefiTargetBootSourceOverride); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ ON_RELEASE: EFI_STATUS ProvisioningComputerSystemProperties ( - IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol, - IN CHAR8 *InputJson, - IN CHAR8 *ResourceId, OPTIONAL + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol, + IN CHAR8 *InputJson, + IN CHAR8 *ResourceId OPTIONAL, IN EFI_STRING ConfigureLang, IN BOOLEAN ProvisionMode, OUT CHAR8 **ResultJson @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( { EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem; EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCs; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystemEmpty; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCsEmpty; EFI_STATUS Status; BOOLEAN PropertyChanged; CHAR8 *AsciiStringValue; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystem ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToStructure failure: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status)); + return Status; + } + + ComputerSystemEmpty = NULL; + Status = JsonStructProtocol->ToStructure ( + JsonStructProtocol, + NULL, + ComputerSystemEmptyJson, + (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystemEmpty + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status)); return Status; } ComputerSystemCs = ComputerSystem->ComputerSystem; + // + // Initial an empty ComputerSystemCS + // + ComputerSystemCsEmpty = ComputerSystemEmpty->ComputerSystem; // // ID // if ((ComputerSystemCs->Id == NULL) && !IS_EMPTY_STRING (ResourceId)) { - ComputerSystemCs->Id = AllocateCopyPool (AsciiStrSize (ResourceId), ResourceId); + ComputerSystemCsEmpty->Id = AllocateCopyPool (AsciiStrSize (ResourceId), ResourceId); } // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"AssetTag", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->AssetTag, AsciiStringValue) != 0)) { - ComputerSystemCs->AssetTag = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->AssetTag = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"BiosVersion", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->BiosVersion, AsciiStringValue) != 0)) { - ComputerSystemCs->BiosVersion = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->BiosVersion = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootNext", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootNext, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootNext = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootNext = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringArrayValue = GetPropertyStringArrayValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootOrder", ConfigureLang, &ArraySize); if (AsciiStringArrayValue != NULL) { if (ProvisionMode || !CompareRedfishStringArrayValues (ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize)) { - AddRedfishCharArray (&ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize); + AddRedfishCharArray (&ComputerSystemCsEmpty->Boot->BootOrder, AsciiStringArrayValue, ArraySize); PropertyChanged = TRUE; } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideEnabled", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideEnabled, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideEnabled = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideEnabled = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideMode", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideMode, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideMode = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideMode = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideTarget", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideTarget, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideTarget = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideTarget = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/UefiTargetBootSourceOverride", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->UefiTargetBootSourceOverride, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->UefiTargetBootSourceOverride = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->UefiTargetBootSourceOverride = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostName", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostName, AsciiStringValue) != 0)) { - ComputerSystemCs->HostName = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostName = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( if (ProvisionMode || (*ComputerSystemCs->HostWatchdogTimer->FunctionEnabled != *BooleanValue)) { IntegerValue = AllocatePool (sizeof (*IntegerValue)); if (IntegerValue != NULL) { - *IntegerValue = (BooleanValue ? 0x01 : 0x00); - ComputerSystemCs->HostWatchdogTimer->FunctionEnabled = IntegerValue; - PropertyChanged = TRUE; + *IntegerValue = (BooleanValue ? 0x01 : 0x00); + ComputerSystemCsEmpty->HostWatchdogTimer->FunctionEnabled = IntegerValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/TimeoutAction", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogTimer->TimeoutAction, AsciiStringValue) != 0)) { - ComputerSystemCs->HostWatchdogTimer->TimeoutAction = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->TimeoutAction = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/WarningAction", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogTimer->WarningAction, AsciiStringValue) != 0)) { - ComputerSystemCs->HostWatchdogTimer->WarningAction = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->WarningAction = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( // // Handle HOSTEDSERVICES // - if (ComputerSystemCs->HostedServices != NULL) { + if (ComputerSystemCsEmpty->HostedServices != NULL) { } // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"IndicatorLED", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->IndicatorLED, AsciiStringValue) != 0)) { - ComputerSystemCs->IndicatorLED = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->IndicatorLED = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Manufacturer", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Manufacturer, AsciiStringValue) != 0)) { - ComputerSystemCs->Manufacturer = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Manufacturer = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/MemoryMirroring", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->MemorySummary->MemoryMirroring, AsciiStringValue) != 0)) { - ComputerSystemCs->MemorySummary->MemoryMirroring = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->MemoryMirroring = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/TotalSystemMemoryGiB", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB != *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemMemoryGiB = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/TotalSystemPersistentMemoryGiB", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSystemPersistentMemoryGiB != *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemPersistentMemoryGiB = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemPersistentMemoryGiB = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Model", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Model, AsciiStringValue) != 0)) { - ComputerSystemCs->Model = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Model = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"PartNumber", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PartNumber, AsciiStringValue) != 0)) { - ComputerSystemCs->PartNumber = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->PartNumber = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"PowerState", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PowerState, AsciiStringValue) != 0)) { - ComputerSystemCs->PowerState = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->PowerState = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Count", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->Count != *NumericValue)) { - ComputerSystemCs->ProcessorSummary->Count = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Count = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/LogicalProcessorCount", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->LogicalProcessorCount != *NumericValue)) { - ComputerSystemCs->ProcessorSummary->LogicalProcessorCount = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->LogicalProcessorCount = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Model", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->ProcessorSummary->Model, AsciiStringValue) != 0)) { - ComputerSystemCs->ProcessorSummary->Model = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Model = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SKU", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SKU, AsciiStringValue) != 0)) { - ComputerSystemCs->SKU = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SKU = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SerialNumber", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SerialNumber, AsciiStringValue) != 0)) { - ComputerSystemCs->SerialNumber = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SerialNumber = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SubModel", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SubModel, AsciiStringValue) != 0)) { - ComputerSystemCs->SubModel = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SubModel = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SystemType", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SystemType, AsciiStringValue) != 0)) { - ComputerSystemCs->SystemType = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SystemType = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( // Status = JsonStructProtocol->ToJson ( JsonStructProtocol, - (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEmpty, ResultJson ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToJson() failed: %r\n", __func__, Status)); return Status; } + if (PropertyChanged) { + // Remove Redfish unchangeable properties. + Status = RedfishRemoveUnchangeableProperties (ResultJson); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable properties from ResultJson.\n", __func__)); + *ResultJson = NULL; + return Status; + } + } + // // Release resource. // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem ); + // + // Free memory allocated for Computersystem empty CS + // + if (ComputerSystemCsEmpty->Boot->BootOrder != NULL) { + DestoryRedfishCharArray (ComputerSystemCsEmpty->Boot->BootOrder, ArraySize); + } + + JsonStructProtocol->DestoryStructure ( + JsonStructProtocol, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEmpty + ); return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND); } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( ) { CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STATUS Status; EFI_STRING NewResourceLocation; CHAR8 *EtagStr; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( &Json ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, provisioning resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: provisioning resource for %s failed: %r\n", __func__, ConfigureLang, Status)); return Status; } + // + // Check and see if platform has OEM data or not + // + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + Status = CreatePayloadToPostResource (Private->RedfishService, Private->Payload, Json, &NewResourceLocation, &EtagStr); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, post ComputerSystem resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: post ComputerSystem resource for %s failed: %r\n", __func__, ConfigureLang, Status)); goto RELEASE_RESOURCE; } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); } - // - // Handle Etag - // +RELEASE_RESOURCE: + if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, NewResourceLocation); FreePool (EtagStr); } -RELEASE_RESOURCE: - if (NewResourceLocation != NULL) { FreePool (NewResourceLocation); } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResources ( Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList); if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count == 0)) { - DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); + DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); return EFI_NOT_FOUND; } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemExistResource ( { EFI_STATUS Status; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; CHAR8 *Json; + CHAR8 *JsonWithAddendum; if (Private == NULL) { return EFI_INVALID_PARAMETER; } - EtagStr = NULL; Json = NULL; ConfigureLang = NULL; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemExistResource ( ); if (EFI_ERROR (Status)) { if (Status == EFI_NOT_FOUND) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + Status = EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: provisioning existing resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } goto ON_RELEASE; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\n", __func__, ConfigureLang)); // - // PUT back to instance + // Check and see if platform has OEM data or not // - Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; } // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource for %s\n", __func__, ConfigureLang)); + + // + // PUT back to instance + // + Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } ON_RELEASE: @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( } // - // Check ETAG to see if we need to check this resource again or not. + // Check ETAG to see if we need to check it // if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { // @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, &Count); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed: %r\n", __func__, Status)); return Status; } if (Count == 0) { - return EFI_NOT_FOUND; + return EFI_UNSUPPORTED; } Status = EFI_SUCCESS; @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( continue; } - DEBUG ((DEBUG_MANAGEABILITY, "%a, [%d] check attribute for: %s\n", __func__, Index, Property)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: [%d] check attribute for: %s\n", __func__, Index, Property)); if (!MatchPropertyWithJsonContext (Property, Json)) { - DEBUG ((DEBUG_MANAGEABILITY, "%a, property is missing: %s\n", __func__, Property)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: property is missing: %s\n", __func__, Property)); Status = EFI_NOT_FOUND; } } @@ -XXX,XX +XXX,XX @@ RedfishUpdateResourceCommon ( { EFI_STATUS Status; CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; if ((Private == NULL) || IS_EMPTY_STRING (InputJson)) { return EFI_INVALID_PARAMETER; } - EtagStr = NULL; Json = NULL; ConfigureLang = NULL; @@ -XXX,XX +XXX,XX @@ RedfishUpdateResourceCommon ( ); if (EFI_ERROR (Status)) { if (Status == EFI_NOT_FOUND) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: update resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + Status = EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, update resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: update resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } goto ON_RELEASE; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", __func__, ConfigureLang)); // - // PUT back to instance + // Check and see if platform has OEM data or not // - Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; } // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + DEBUG ((REDFISH_DEBUG_TRACE, "%a: update resource for %s\n", __func__, ConfigureLang)); + + // + // PUT back to instance + // + Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } ON_RELEASE: @@ -XXX,XX +XXX,XX @@ RedfishIdentifyResourceCommon ( if (Supported) { Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status)); return Status; } if (ConfigLangList.Count == 0) { + DEBUG ((DEBUG_MANAGEABILITY, " No platform Redfish ConfigureLang found for %s\n", __func__, Private->Uri)); return EFI_SUCCESS; } diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c @@ -XXX,XX +XXX,XX @@ extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; extern EFI_HANDLE mRedfishResourceConfigProtocolHandle; /** - Provisioning redfish resource by given URI. + Provision redfish resource by given URI. @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. @param[in] Uri Target URI to create resource. @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( return EFI_INVALID_PARAMETER; } - DEBUG ((DEBUG_MANAGEABILITY, "%a, provisioning in %s mode\n", __func__, (PostMode ? L"POST" : L"PATCH"))); + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning in %s mode\n", __func__, (PostMode ? L"POST" : L"PATCH"))); Private = REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL (This); @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( ASSERT (Private->Payload != NULL); Status = RedfishProvisioningResourceCommon (Private, !PostMode); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: failed to provision resource to: %s: %r\n", __func__, Uri, Status)); + } else { + // + // Get latest ETag on URI and keep it in variable. + // + SetEtagFromUri (Private->RedfishService, Private->Uri, TRUE); + } // // Release resource @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( Response.Headers, Response.Payload ); - RedfishHttpResetResource (Uri); Private->Payload = NULL; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( Private->Uri = PendingSettingUri; ExpectedResponse = &PendingSettingResponse; } else { + DEBUG ((REDFISH_DEBUG_TRACE, "%a: No @Redfish.Settings is found\n", __func__)); Private->Uri = Uri; ExpectedResponse = &Response; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( GetHttpResponseEtag (ExpectedResponse, &Etag); Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag); if (EFI_ERROR (Status)) { - if (Status != EFI_ALREADY_STARTED) { - DEBUG ((DEBUG_ERROR, "%a, failed to consume resource from: %s: %r\n", __func__, Uri, Status)); - } - } else { - // - // Keep etag after consuming pending settings. - // - if (Etag != NULL) { - SetEtagWithUri (Etag, Private->Uri); - } + DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", __func__, Private->Uri, Status)); + } + + // + // Release resource + // + if (Etag != NULL) { + FreePool (Etag); } // @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( Private->Json = NULL; } - if (Etag != NULL) { - FreePool (Etag); - } - return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceUpdate ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceUpdate ( Status = RedfishUpdateResourceCommon (Private, Private->Json); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to update resource from: %s: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to update resource to: %s: %r\n", __func__, Uri, Status)); + } else { + // + // Get latest ETag on URI and keep it in variable. + // + SetEtagFromUri (Private->RedfishService, Private->Uri, TRUE); } // @@ -XXX,XX +XXX,XX @@ RedfishResourceCheck ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceCheck ( GetHttpResponseEtag (&Response, &Etag); Status = RedfishCheckResourceCommon (Private, Private->Json, Etag); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to check resource from: %s: %r\n", __func__, Uri, Status)); } // // Release resource // + if (Etag != NULL) { + FreePool (Etag); + } + if (Private->Payload != NULL) { RedfishFreeResponse ( Response.StatusCode, @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentify ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentify ( Status = RedfishIdentifyResourceCommon (Private, Private->Json); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: identify %s failed: %r\n", __func__, Uri, Status)); } // @@ -XXX,XX +XXX,XX @@ EfiRestJasonStructureProtocolIsReady ( (VOID **)&mRedfishResourcePrivate->JsonStructProtocol ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to locate gEfiRestJsonStructureProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to locate gEfiRestJsonStructureProtocolGuid: %r\n", __func__, Status)); } gBS->CloseEvent (Event); @@ -XXX,XX +XXX,XX @@ RedfishResourceUnload ( @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_ACCESS_DENIED EFI_ISCSI_INITIATOR_NAME_PROTOCOL was installed unexpectedly. @retval Others Other errors as indicated. **/ EFI_STATUS -- 2.37.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114482): https://edk2.groups.io/g/devel/message/114482 Mute This Topic: https://groups.io/mt/103967793/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
From: Abner Chang <abner.chang@amd.com> Update Redfish ComputerSystem_1_5_0 feature driver to align the implementation with latest code. This driver handles all of ComputerSystem v1_5_0 properties and incorporate with Redfish simualtor. Signed-off-by: Abner Chang <abner.chang@amd.com> Cc: Nickle Wang <nicklew@nvidia.com> Cc: Igor Kulchytskyy <igork@ami.com> --- .../v1_5_0/Dxe/ComputerSystemDxe.inf | 1 + .../v1_5_0/Common/ComputerSystemCommon.c | 347 ++++++++++++------ .../v1_5_0/Dxe/ComputerSystemDxe.c | 64 ++-- 3 files changed, 271 insertions(+), 141 deletions(-) diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentifyLib UefiLib UefiDriverEntryPoint + RedfishAddendumLib RedfishHttpCacheLib [Protocols] diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystem ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, Status)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( // // No change // - DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume action\n", __func__, Private->Uri)); - Status = EFI_ALREADY_STARTED; + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore consume action\n", __func__, Private->Uri)); + Status = EFI_SUCCESS; goto ON_RELEASE; } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootOrder); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideEnabled); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideMode); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ RedfishConsumeResourceCommon ( if (ConfigureLang != NULL) { Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->UefiTargetBootSourceOverride); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __func__, ConfigureLang, Status)); } FreePool (ConfigureLang); } else { - DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", __func__, Private->Uri)); + DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", __func__, Private->Uri)); } } @@ -XXX,XX +XXX,XX @@ ON_RELEASE: EFI_STATUS ProvisioningComputerSystemProperties ( - IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol, - IN CHAR8 *InputJson, - IN CHAR8 *ResourceId, OPTIONAL + IN EFI_REST_JSON_STRUCTURE_PROTOCOL *JsonStructProtocol, + IN CHAR8 *InputJson, + IN CHAR8 *ResourceId OPTIONAL, IN EFI_STRING ConfigureLang, IN BOOLEAN ProvisionMode, OUT CHAR8 **ResultJson @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( { EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystem; EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCs; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0 *ComputerSystemEmpty; + EFI_REDFISH_COMPUTERSYSTEM_V1_5_0_CS *ComputerSystemCsEmpty; EFI_STATUS Status; BOOLEAN PropertyChanged; CHAR8 *AsciiStringValue; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystem ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToStructure failure: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status)); + return Status; + } + + ComputerSystemEmpty = NULL; + Status = JsonStructProtocol->ToStructure ( + JsonStructProtocol, + NULL, + ComputerSystemEmptyJson, + (EFI_REST_JSON_STRUCTURE_HEADER **)&ComputerSystemEmpty + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status)); return Status; } ComputerSystemCs = ComputerSystem->ComputerSystem; + // + // Initial an empty ComputerSystemCS + // + ComputerSystemCsEmpty = ComputerSystemEmpty->ComputerSystem; // // ID // if ((ComputerSystemCs->Id == NULL) && !IS_EMPTY_STRING (ResourceId)) { - ComputerSystemCs->Id = AllocateCopyPool (AsciiStrSize (ResourceId), ResourceId); + ComputerSystemCsEmpty->Id = AllocateCopyPool (AsciiStrSize (ResourceId), ResourceId); } // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"AssetTag", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->AssetTag, AsciiStringValue) != 0)) { - ComputerSystemCs->AssetTag = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->AssetTag = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"BiosVersion", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->BiosVersion, AsciiStringValue) != 0)) { - ComputerSystemCs->BiosVersion = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->BiosVersion = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootNext", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootNext, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootNext = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootNext = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringArrayValue = GetPropertyStringArrayValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootOrder", ConfigureLang, &ArraySize); if (AsciiStringArrayValue != NULL) { if (ProvisionMode || !CompareRedfishStringArrayValues (ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize)) { - AddRedfishCharArray (&ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize); + AddRedfishCharArray (&ComputerSystemCsEmpty->Boot->BootOrder, AsciiStringArrayValue, ArraySize); PropertyChanged = TRUE; } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideEnabled", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideEnabled, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideEnabled = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideEnabled = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideMode", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideMode, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideMode = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideMode = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideTarget", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSourceOverrideTarget, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->BootSourceOverrideTarget = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideTarget = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Boot/UefiTargetBootSourceOverride", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->UefiTargetBootSourceOverride, AsciiStringValue) != 0)) { - ComputerSystemCs->Boot->UefiTargetBootSourceOverride = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Boot->UefiTargetBootSourceOverride = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostName", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostName, AsciiStringValue) != 0)) { - ComputerSystemCs->HostName = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostName = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( if (ProvisionMode || (*ComputerSystemCs->HostWatchdogTimer->FunctionEnabled != *BooleanValue)) { IntegerValue = AllocatePool (sizeof (*IntegerValue)); if (IntegerValue != NULL) { - *IntegerValue = (BooleanValue ? 0x01 : 0x00); - ComputerSystemCs->HostWatchdogTimer->FunctionEnabled = IntegerValue; - PropertyChanged = TRUE; + *IntegerValue = (BooleanValue ? 0x01 : 0x00); + ComputerSystemCsEmpty->HostWatchdogTimer->FunctionEnabled = IntegerValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/TimeoutAction", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogTimer->TimeoutAction, AsciiStringValue) != 0)) { - ComputerSystemCs->HostWatchdogTimer->TimeoutAction = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->TimeoutAction = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/WarningAction", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogTimer->WarningAction, AsciiStringValue) != 0)) { - ComputerSystemCs->HostWatchdogTimer->WarningAction = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->WarningAction = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( // // Handle HOSTEDSERVICES // - if (ComputerSystemCs->HostedServices != NULL) { + if (ComputerSystemCsEmpty->HostedServices != NULL) { } // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"IndicatorLED", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->IndicatorLED, AsciiStringValue) != 0)) { - ComputerSystemCs->IndicatorLED = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->IndicatorLED = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Manufacturer", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Manufacturer, AsciiStringValue) != 0)) { - ComputerSystemCs->Manufacturer = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Manufacturer = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/MemoryMirroring", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->MemorySummary->MemoryMirroring, AsciiStringValue) != 0)) { - ComputerSystemCs->MemorySummary->MemoryMirroring = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->MemoryMirroring = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/TotalSystemMemoryGiB", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB != *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemMemoryGiB = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"MemorySummary/TotalSystemPersistentMemoryGiB", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSystemPersistentMemoryGiB != *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemPersistentMemoryGiB = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemPersistentMemoryGiB = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"Model", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Model, AsciiStringValue) != 0)) { - ComputerSystemCs->Model = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->Model = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"PartNumber", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PartNumber, AsciiStringValue) != 0)) { - ComputerSystemCs->PartNumber = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->PartNumber = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"PowerState", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PowerState, AsciiStringValue) != 0)) { - ComputerSystemCs->PowerState = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->PowerState = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Count", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->Count != *NumericValue)) { - ComputerSystemCs->ProcessorSummary->Count = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Count = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( NumericValue = GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/LogicalProcessorCount", ConfigureLang); if (NumericValue != NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->LogicalProcessorCount != *NumericValue)) { - ComputerSystemCs->ProcessorSummary->LogicalProcessorCount = NumericValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->LogicalProcessorCount = NumericValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Model", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->ProcessorSummary->Model, AsciiStringValue) != 0)) { - ComputerSystemCs->ProcessorSummary->Model = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Model = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SKU", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SKU, AsciiStringValue) != 0)) { - ComputerSystemCs->SKU = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SKU = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SerialNumber", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SerialNumber, AsciiStringValue) != 0)) { - ComputerSystemCs->SerialNumber = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SerialNumber = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SubModel", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SubModel, AsciiStringValue) != 0)) { - ComputerSystemCs->SubModel = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SubModel = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( AsciiStringValue = GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, L"SystemType", ConfigureLang); if (AsciiStringValue != NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SystemType, AsciiStringValue) != 0)) { - ComputerSystemCs->SystemType = AsciiStringValue; - PropertyChanged = TRUE; + ComputerSystemCsEmpty->SystemType = AsciiStringValue; + PropertyChanged = TRUE; } } } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( // Status = JsonStructProtocol->ToJson ( JsonStructProtocol, - (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEmpty, ResultJson ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToJson() failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: ToJson() failed: %r\n", __func__, Status)); return Status; } + if (PropertyChanged) { + // Remove Redfish unchangeable properties. + Status = RedfishRemoveUnchangeableProperties (ResultJson); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable properties from ResultJson.\n", __func__)); + *ResultJson = NULL; + return Status; + } + } + // // Release resource. // @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemProperties ( (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem ); + // + // Free memory allocated for Computersystem empty CS + // + if (ComputerSystemCsEmpty->Boot->BootOrder != NULL) { + DestoryRedfishCharArray (ComputerSystemCsEmpty->Boot->BootOrder, ArraySize); + } + + JsonStructProtocol->DestoryStructure ( + JsonStructProtocol, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEmpty + ); return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND); } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( ) { CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STATUS Status; EFI_STRING NewResourceLocation; CHAR8 *EtagStr; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( &Json ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, provisioning resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: provisioning resource for %s failed: %r\n", __func__, ConfigureLang, Status)); return Status; } + // + // Check and see if platform has OEM data or not + // + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + Status = CreatePayloadToPostResource (Private->RedfishService, Private->Payload, Json, &NewResourceLocation, &EtagStr); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, post ComputerSystem resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: post ComputerSystem resource for %s failed: %r\n", __func__, ConfigureLang, Status)); goto RELEASE_RESOURCE; } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResource ( RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); } - // - // Handle Etag - // +RELEASE_RESOURCE: + if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, NewResourceLocation); FreePool (EtagStr); } -RELEASE_RESOURCE: - if (NewResourceLocation != NULL) { FreePool (NewResourceLocation); } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemResources ( Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList); if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count == 0)) { - DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); + DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure language: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); return EFI_NOT_FOUND; } @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemExistResource ( { EFI_STATUS Status; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; CHAR8 *Json; + CHAR8 *JsonWithAddendum; if (Private == NULL) { return EFI_INVALID_PARAMETER; } - EtagStr = NULL; Json = NULL; ConfigureLang = NULL; @@ -XXX,XX +XXX,XX @@ ProvisioningComputerSystemExistResource ( ); if (EFI_ERROR (Status)) { if (Status == EFI_NOT_FOUND) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + Status = EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: provisioning existing resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } goto ON_RELEASE; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, provisioning existing resource for %s\n", __func__, ConfigureLang)); // - // PUT back to instance + // Check and see if platform has OEM data or not // - Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; } // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource for %s\n", __func__, ConfigureLang)); + + // + // PUT back to instance + // + Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } ON_RELEASE: @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( } // - // Check ETAG to see if we need to check this resource again or not. + // Check ETAG to see if we need to check it // if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { // @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( Status = RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, &Count); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed: %r\n", __func__, Status)); return Status; } if (Count == 0) { - return EFI_NOT_FOUND; + return EFI_UNSUPPORTED; } Status = EFI_SUCCESS; @@ -XXX,XX +XXX,XX @@ RedfishCheckResourceCommon ( continue; } - DEBUG ((DEBUG_MANAGEABILITY, "%a, [%d] check attribute for: %s\n", __func__, Index, Property)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: [%d] check attribute for: %s\n", __func__, Index, Property)); if (!MatchPropertyWithJsonContext (Property, Json)) { - DEBUG ((DEBUG_MANAGEABILITY, "%a, property is missing: %s\n", __func__, Property)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: property is missing: %s\n", __func__, Property)); Status = EFI_NOT_FOUND; } } @@ -XXX,XX +XXX,XX @@ RedfishUpdateResourceCommon ( { EFI_STATUS Status; CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; if ((Private == NULL) || IS_EMPTY_STRING (InputJson)) { return EFI_INVALID_PARAMETER; } - EtagStr = NULL; Json = NULL; ConfigureLang = NULL; @@ -XXX,XX +XXX,XX @@ RedfishUpdateResourceCommon ( ); if (EFI_ERROR (Status)) { if (Status == EFI_NOT_FOUND) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: update resource for %s ignored. Nothing changed\n", __func__, ConfigureLang)); + Status = EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, update resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: update resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } goto ON_RELEASE; } - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", __func__, ConfigureLang)); // - // PUT back to instance + // Check and see if platform has OEM data or not // - Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); + Status = RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; } // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr != NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status = RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum != NULL)) { + FreePool (Json); + Json = JsonWithAddendum; + JsonWithAddendum = NULL; + } + + DEBUG ((REDFISH_DEBUG_TRACE, "%a: update resource for %s\n", __func__, ConfigureLang)); + + // + // PUT back to instance + // + Status = CreatePayloadToPatchResource (Private->RedfishService, Private->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func__, ConfigureLang, Status)); } ON_RELEASE: @@ -XXX,XX +XXX,XX @@ RedfishIdentifyResourceCommon ( if (Supported) { Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetUnifiedArrayTypeConfigureLang failed: %r\n", __func__, Status)); return Status; } if (ConfigLangList.Count == 0) { + DEBUG ((DEBUG_MANAGEABILITY, "%a: No platform Redfish ConfigureLang found for %s\n", __func__, Private->Uri)); return EFI_SUCCESS; } diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c index XXXXXXX..XXXXXXX 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c @@ -XXX,XX +XXX,XX @@ extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResourcePrivate; extern EFI_HANDLE mRedfishResourceConfigProtocolHandle; /** - Provisioning redfish resource by given URI. + Provision redfish resource by given URI. @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL instance. @param[in] Uri Target URI to create resource. @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( return EFI_INVALID_PARAMETER; } - DEBUG ((DEBUG_MANAGEABILITY, "%a, provisioning in %s mode\n", __func__, (PostMode ? L"POST" : L"PATCH"))); + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning in %s mode\n", __func__, (PostMode ? L"POST" : L"PATCH"))); Private = REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL (This); @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( ASSERT (Private->Payload != NULL); Status = RedfishProvisioningResourceCommon (Private, !PostMode); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: failed to provision resource to: %s: %r\n", __func__, Uri, Status)); + } else { + // + // Get latest ETag on URI and keep it in variable. + // + SetEtagFromUri (Private->RedfishService, Private->Uri, TRUE); + } // // Release resource @@ -XXX,XX +XXX,XX @@ RedfishResourceProvisioningResource ( Response.Headers, Response.Payload ); - RedfishHttpResetResource (Uri); Private->Payload = NULL; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( Private->Uri = PendingSettingUri; ExpectedResponse = &PendingSettingResponse; } else { + DEBUG ((REDFISH_DEBUG_TRACE, "%a: No @Redfish.Settings is found\n", __func__)); Private->Uri = Uri; ExpectedResponse = &Response; } @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( GetHttpResponseEtag (ExpectedResponse, &Etag); Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag); if (EFI_ERROR (Status)) { - if (Status != EFI_ALREADY_STARTED) { - DEBUG ((DEBUG_ERROR, "%a, failed to consume resource from: %s: %r\n", __func__, Uri, Status)); - } - } else { - // - // Keep etag after consuming pending settings. - // - if (Etag != NULL) { - SetEtagWithUri (Etag, Private->Uri); - } + DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n", __func__, Private->Uri, Status)); + } + + // + // Release resource + // + if (Etag != NULL) { + FreePool (Etag); } // @@ -XXX,XX +XXX,XX @@ RedfishResourceConsumeResource ( Private->Json = NULL; } - if (Etag != NULL) { - FreePool (Etag); - } - return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceUpdate ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceUpdate ( Status = RedfishUpdateResourceCommon (Private, Private->Json); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to update resource from: %s: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to update resource to: %s: %r\n", __func__, Uri, Status)); + } else { + // + // Get latest ETag on URI and keep it in variable. + // + SetEtagFromUri (Private->RedfishService, Private->Uri, TRUE); } // @@ -XXX,XX +XXX,XX @@ RedfishResourceCheck ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceCheck ( GetHttpResponseEtag (&Response, &Etag); Status = RedfishCheckResourceCommon (Private, Private->Json, Etag); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to check resource from: %s: %r\n", __func__, Uri, Status)); } // // Release resource // + if (Etag != NULL) { + FreePool (Etag); + } + if (Private->Payload != NULL) { RedfishFreeResponse ( Response.StatusCode, @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentify ( ZeroMem (&Response, sizeof (Response)); Status = RedfishHttpGetResource (Private->RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, Uri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri)); return Status; } @@ -XXX,XX +XXX,XX @@ RedfishResourceIdentify ( Status = RedfishIdentifyResourceCommon (Private, Private->Json); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __func__, Uri, Status)); + DEBUG ((DEBUG_ERROR, "%a: identify %s failed: %r\n", __func__, Uri, Status)); } // @@ -XXX,XX +XXX,XX @@ EfiRestJasonStructureProtocolIsReady ( (VOID **)&mRedfishResourcePrivate->JsonStructProtocol ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to locate gEfiRestJsonStructureProtocolGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to locate gEfiRestJsonStructureProtocolGuid: %r\n", __func__, Status)); } gBS->CloseEvent (Event); @@ -XXX,XX +XXX,XX @@ RedfishResourceUnload ( @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_ACCESS_DENIED EFI_ISCSI_INITIATOR_NAME_PROTOCOL was installed unexpectedly. @retval Others Other errors as indicated. **/ EFI_STATUS -- 2.37.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114486): https://edk2.groups.io/g/devel/message/114486 Mute This Topic: https://groups.io/mt/103968965/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-