From nobody Fri May 10 07:08:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114486+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1706236167019117.8307964426948; Thu, 25 Jan 2024 18:29:27 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=lhoVDgW4ThB1IvNdI/YUBFiWU60nhysxOnQGAbhguio=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706236166; v=1; b=BsmEevXSecO4jXcbBpjRRYAej40BCt35iWO9vBgouTocEL/XY/hKrAabDIaXq5GHUDcDMWjF eFNLxE0lpQ7VgxUwpvaRHhwiI1I4VeItoF1iRkMlhUe6naIXgWIyiStd+sPX2L0elWs6rfsASZM s/fCNAAn0KJpGp4ovPQwR89I= X-Received: by 127.0.0.2 with SMTP id gIVfYY1788612xG0gv7rhPW9; Thu, 25 Jan 2024 18:29:26 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.88]) by mx.groups.io with SMTP id smtpd.web10.6491.1706236165448919204 for ; Thu, 25 Jan 2024 18:29:25 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c97MAnG9GOfWZ1tIzb8HHhjHtLwLKKpVajVG33D9/BO5Elwsybmh7fFDLvDXHENi3wfgCGgAYE9JUHKvtjDKfl6jMlP0XlK1IkyrspWIMBtGrwx8/diPpeP0RaxH1pNFuuT/vS47SR9vPPzsa+CPi35D05rL64pwo80kqBVyvnV3XBSLEvjuRIbtp6sKyndY6gWr88BVVYUvc+NcJmZKI1hj+mLH/3bJos8jEV+VHUbrBQXuHL8i1EKjqdw/rXb1ueSlN82nUIoRH2oWuRg59MkuJrUuW02VNnQnPBb20whbbIJ/h8CWDccLXY3swSAVRCgWH3BxPrhFN43IscBy6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u8kbt1dcFfynyBLGBsw10tdc9sRrmbQZ6aqZ+4flmko=; b=kg6vj/YcwdSUBInwSLPhkIxLH63yagXt011vmIbVW/4dGrQz1Wi7OaOHMLiHIGSzWsK9WSAYNFvp/B7pLidFMKgK/erfDcYCrutHPIfloyNCdfml3U1p4EbKj2COieFSk1FzaACxqIIU1nDOEZ8LxGaQ5f9aw78x2Mv07w6pF6s0voVf5wxSymAZxgPL7BEdilGJGy0pWKnkf48CdBXtr+WdcyOrhG7axKzLxcRualkKZKitN+ajue6d1ApGYygRKkHbSQc/hHJlcdkVIO3s/Y2DUv2P50z8w7TfQZ0gIkYkfJ6lGtu84e1+CeTwOuIsxE7k6ekiYMwnXkcK+H9t2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CY8P220CA0047.NAMP220.PROD.OUTLOOK.COM (2603:10b6:930:47::6) by DS0PR12MB8366.namprd12.prod.outlook.com (2603:10b6:8:f9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 02:29:20 +0000 X-Received: from CY4PEPF0000E9D0.namprd03.prod.outlook.com (2603:10b6:930:47:cafe::f8) by CY8P220CA0047.outlook.office365.com (2603:10b6:930:47::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26 via Frontend Transport; Fri, 26 Jan 2024 02:29:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+114486+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9D0.mail.protection.outlook.com (10.167.241.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7228.16 via Frontend Transport; Fri, 26 Jan 2024 02:29:20 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 25 Jan 2024 20:29:17 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver Date: Fri, 26 Jan 2024 10:29:01 +0800 Message-ID: <20240126022901.1132-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D0:EE_|DS0PR12MB8366:EE_ X-MS-Office365-Filtering-Correlation-Id: 55111e42-cc45-46d6-e79b-08dc1e169a13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: oCvUmxcSB06TXF6ZAMEix1UXCIkheCUDwgCwv8+s763mOMmlXBiH9n7M31qXLzZ4b+V3+qUuOXrfiyX6uIuqLNZzQZdZzjHCyaChl7zbR9+C+K+mx9derDYrY8DauqZ4gcmBIluZNEh08I3Uhq7Y6zRlSrGrB67Jp9WK36yy2IP3Gcl87SvmlAU4mQHjSKUQsjqPe++Z/NjvaYr7xuifz6b5Lpe6bDvvB6VwhEcJBhG1/gRvTEEi6tz6owvJ8g9MSfTykCsn6pAC0fi9CdtZGGSBXjF/Z7hsDQIh0JBLGFJD4VoqP5s5rhX1RGshmLl5I2UMKeAyeuRCNxMKmtyH76VaWT0uK+m2VAC9hZykjjCmpuo89q64DmpciFWt0l+EXcJ6KMvLvfEz55POsgNuu1Pm7kc8ZXdGr8EmFOsrr1OiwUD317SfFwfcO0jB0IOgV9uCsK2f80fyCkVHT+CORLLMueHN5dOdK+TbtfbVk9zqQj1Bg2X8/jaUP+Rhd8J15dGMgrPkv9MB3auAOcc4DgV2S4i3o2+h1b6SMJE44OcOjVlkrcjjBrzQW/vqrSQIZ5OCJuaVuMv21NjHv33vUpL/1PGZWrBiTCxl32L7XsqKEiMCgFsUz4IXE8INyNKg2GQhzZnDYmavFBEZnyrzmrT/pbo0X4uTTuTUFhkMOC7Yj+6EGDCrB0/u9m1ItMYkH5AzwdQzMYnXZ6nL43G/muVbewC4AemOYexiD65FtETCeJUm443pweZGk68xjs5mv7FQmWlvohdEtzJR2iNExu/JgW4FMo0j7HvmQkLiCLsDBDLsjh+oKhR+SJyKTuPHs5vrE1rsrUxtoyJq9sumQg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 02:29:20.1939 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55111e42-cc45-46d6-e79b-08dc1e169a13 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8366 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vI3qqTra7u4Z9ayjoqu5TH6tx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1706236168059100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang 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 Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- .../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/ComputerSy= stemDxe.inf b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerS= ystemDxe.inf index 36cbe06211..4e7dc5c7c5 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .inf +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .inf @@ -37,6 +37,7 @@ RedfishResourceIdentifyLib UefiLib UefiDriverEntryPoint + RedfishAddendumLib RedfishHttpCacheLib =20 [Protocols] diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Compute= rSystemCommon.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Co= mputerSystemCommon.c index 3ace03bd4c..a67ef3dac2 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystem= Common.c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystem= Common.c @@ -53,7 +53,7 @@ RedfishConsumeResourceCommon ( (EFI_REST_JSON_STRUCTURE_HEADER = **)&ComputerSystem ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Statu= s)); + DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, Statu= s)); return Status; } =20 @@ -66,8 +66,8 @@ RedfishConsumeResourceCommon ( // // No change // - DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consu= me action\n", __func__, Private->Uri)); - Status =3D EFI_ALREADY_STARTED; + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore consu= me action\n", __func__, Private->Uri)); + Status =3D EFI_SUCCESS; goto ON_RELEASE; } =20 @@ -154,12 +154,12 @@ RedfishConsumeResourceCommon ( if (ConfigureLang !=3D NULL) { Status =3D ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, RES= OURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootOrder); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); } =20 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)); } } =20 @@ -174,12 +174,12 @@ RedfishConsumeResourceCommon ( if (ConfigureLang !=3D NULL) { Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideE= nabled); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); } =20 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)); } } =20 @@ -194,12 +194,12 @@ RedfishConsumeResourceCommon ( if (ConfigureLang !=3D NULL) { Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootSourceOverrideM= ode); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); } =20 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)); } } =20 @@ -234,12 +234,12 @@ RedfishConsumeResourceCommon ( if (ConfigureLang !=3D NULL) { Status =3D ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->UefiTargetBootSourc= eOverride); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); } =20 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)); } } =20 @@ -742,9 +742,9 @@ ON_RELEASE: =20 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 @@ -752,6 +752,8 @@ 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; @@ -778,17 +780,33 @@ 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 =3D NULL; + Status =3D JsonStructProtocol->ToStructure ( + JsonStructProtocol, + NULL, + ComputerSystemEmptyJson, + (EFI_REST_JSON_STRUCTURE_HEA= DER **)&ComputerSystemEmpty + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Status= )); return Status; } =20 ComputerSystemCs =3D ComputerSystem->ComputerSystem; + // + // Initial an empty ComputerSystemCS + // + ComputerSystemCsEmpty =3D ComputerSystemEmpty->ComputerSystem; =20 // // ID // if ((ComputerSystemCs->Id =3D=3D NULL) && !IS_EMPTY_STRING (ResourceId))= { - ComputerSystemCs->Id =3D AllocateCopyPool (AsciiStrSize (ResourceId), = ResourceId); + ComputerSystemCsEmpty->Id =3D AllocateCopyPool (AsciiStrSize (Resource= Id), ResourceId); } =20 // @@ -798,8 +816,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"AssetTag", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->AssetTag, Ascii= StringValue) !=3D 0)) { - ComputerSystemCs->AssetTag =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->AssetTag =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -811,8 +829,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"BiosVersion", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->BiosVersion, As= ciiStringValue) !=3D 0)) { - ComputerSystemCs->BiosVersion =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->BiosVersion =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -828,8 +846,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"Boot/BootNext", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootNex= t, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->Boot->BootNext =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Boot->BootNext =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -841,7 +859,7 @@ ProvisioningComputerSystemProperties ( AsciiStringArrayValue =3D GetPropertyStringArrayValue (RESOURCE_SCHE= MA, RESOURCE_SCHEMA_VERSION, L"Boot/BootOrder", ConfigureLang, &ArraySize); if (AsciiStringArrayValue !=3D NULL) { if (ProvisionMode || !CompareRedfishStringArrayValues (ComputerSys= temCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize)) { - AddRedfishCharArray (&ComputerSystemCs->Boot->BootOrder, AsciiSt= ringArrayValue, ArraySize); + AddRedfishCharArray (&ComputerSystemCsEmpty->Boot->BootOrder, As= ciiStringArrayValue, ArraySize); PropertyChanged =3D TRUE; } } @@ -854,8 +872,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"Boot/BootSourceOverrideEnabled", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSou= rceOverrideEnabled, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->Boot->BootSourceOverrideEnabled =3D AsciiStrin= gValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideEnabled =3D Ascii= StringValue; + PropertyChanged =3D TRUE; } } } @@ -867,8 +885,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"Boot/BootSourceOverrideMode", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSou= rceOverrideMode, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->Boot->BootSourceOverrideMode =3D AsciiStringVa= lue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideMode =3D AsciiStr= ingValue; + PropertyChanged =3D TRUE; } } } @@ -880,8 +898,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"Boot/BootSourceOverrideTarget", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootSou= rceOverrideTarget, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->Boot->BootSourceOverrideTarget =3D AsciiString= Value; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Boot->BootSourceOverrideTarget =3D AsciiS= tringValue; + PropertyChanged =3D TRUE; } } } @@ -893,8 +911,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"Boot/UefiTargetBootSourceOverride", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->UefiTar= getBootSourceOverride, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->Boot->UefiTargetBootSourceOverride =3D AsciiSt= ringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Boot->UefiTargetBootSourceOverride =3D As= ciiStringValue; + PropertyChanged =3D TR= UE; } } } @@ -907,8 +925,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"HostName", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostName, Ascii= StringValue) !=3D 0)) { - ComputerSystemCs->HostName =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->HostName =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -926,9 +944,9 @@ ProvisioningComputerSystemProperties ( if (ProvisionMode || (*ComputerSystemCs->HostWatchdogTimer->Functi= onEnabled !=3D *BooleanValue)) { IntegerValue =3D AllocatePool (sizeof (*IntegerValue)); if (IntegerValue !=3D NULL) { - *IntegerValue =3D (Bool= eanValue ? 0x01 : 0x00); - ComputerSystemCs->HostWatchdogTimer->FunctionEnabled =3D Integ= erValue; - PropertyChanged =3D TRUE; + *IntegerValue =3D = (BooleanValue ? 0x01 : 0x00); + ComputerSystemCsEmpty->HostWatchdogTimer->FunctionEnabled =3D = IntegerValue; + PropertyChanged =3D = TRUE; } } } @@ -941,8 +959,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"HostWatchdogTimer/TimeoutAction", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogT= imer->TimeoutAction, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->HostWatchdogTimer->TimeoutAction =3D AsciiStri= ngValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->TimeoutAction =3D Asci= iStringValue; + PropertyChanged =3D TRUE; } } } @@ -954,8 +972,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"HostWatchdogTimer/WarningAction", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->HostWatchdogT= imer->WarningAction, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->HostWatchdogTimer->WarningAction =3D AsciiStri= ngValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->HostWatchdogTimer->WarningAction =3D Asci= iStringValue; + PropertyChanged =3D TRUE; } } } @@ -964,7 +982,7 @@ ProvisioningComputerSystemProperties ( // // Handle HOSTEDSERVICES // - if (ComputerSystemCs->HostedServices !=3D NULL) { + if (ComputerSystemCsEmpty->HostedServices !=3D NULL) { } =20 // @@ -981,8 +999,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"IndicatorLED", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->IndicatorLED, A= sciiStringValue) !=3D 0)) { - ComputerSystemCs->IndicatorLED =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->IndicatorLED =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -994,8 +1012,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"Manufacturer", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Manufacturer, A= sciiStringValue) !=3D 0)) { - ComputerSystemCs->Manufacturer =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Manufacturer =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1011,8 +1029,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"MemorySummary/MemoryMirroring", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->MemorySummary= ->MemoryMirroring, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->MemorySummary->MemoryMirroring =3D AsciiString= Value; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->MemorySummary->MemoryMirroring =3D AsciiS= tringValue; + PropertyChanged =3D TRUE; } } } @@ -1024,8 +1042,8 @@ ProvisioningComputerSystemProperties ( NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_= SCHEMA_VERSION, L"MemorySummary/TotalSystemMemoryGiB", ConfigureLang); if (NumericValue !=3D NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSyste= mMemoryGiB !=3D *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB =3D Numeri= cValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemMemoryGiB =3D N= umericValue; + PropertyChanged =3D T= RUE; } } } @@ -1037,8 +1055,8 @@ ProvisioningComputerSystemProperties ( NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_= SCHEMA_VERSION, L"MemorySummary/TotalSystemPersistentMemoryGiB", ConfigureL= ang); if (NumericValue !=3D NULL) { if (ProvisionMode || (*ComputerSystemCs->MemorySummary->TotalSyste= mPersistentMemoryGiB !=3D *NumericValue)) { - ComputerSystemCs->MemorySummary->TotalSystemPersistentMemoryGiB = =3D NumericValue; - PropertyChanged = =3D TRUE; + ComputerSystemCsEmpty->MemorySummary->TotalSystemPersistentMemor= yGiB =3D NumericValue; + PropertyChanged = =3D TRUE; } } } @@ -1051,8 +1069,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"Model", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Model, AsciiStr= ingValue) !=3D 0)) { - ComputerSystemCs->Model =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->Model =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1078,8 +1096,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"PartNumber", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PartNumber, Asc= iiStringValue) !=3D 0)) { - ComputerSystemCs->PartNumber =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->PartNumber =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1091,8 +1109,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"PowerState", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->PowerState, Asc= iiStringValue) !=3D 0)) { - ComputerSystemCs->PowerState =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->PowerState =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1108,8 +1126,8 @@ ProvisioningComputerSystemProperties ( NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_= SCHEMA_VERSION, L"ProcessorSummary/Count", ConfigureLang); if (NumericValue !=3D NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->Count != =3D *NumericValue)) { - ComputerSystemCs->ProcessorSummary->Count =3D NumericValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Count =3D NumericValue; + PropertyChanged =3D TRUE; } } } @@ -1121,8 +1139,8 @@ ProvisioningComputerSystemProperties ( NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, RESOURCE_= SCHEMA_VERSION, L"ProcessorSummary/LogicalProcessorCount", ConfigureLang); if (NumericValue !=3D NULL) { if (ProvisionMode || (*ComputerSystemCs->ProcessorSummary->Logical= ProcessorCount !=3D *NumericValue)) { - ComputerSystemCs->ProcessorSummary->LogicalProcessorCount =3D Nu= mericValue; - PropertyChanged =3D TR= UE; + ComputerSystemCsEmpty->ProcessorSummary->LogicalProcessorCount = =3D NumericValue; + PropertyChanged = =3D TRUE; } } } @@ -1134,8 +1152,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOUR= CE_SCHEMA_VERSION, L"ProcessorSummary/Model", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->ProcessorSumm= ary->Model, AsciiStringValue) !=3D 0)) { - ComputerSystemCs->ProcessorSummary->Model =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->ProcessorSummary->Model =3D AsciiStringVa= lue; + PropertyChanged =3D TRUE; } } } @@ -1155,8 +1173,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"SKU", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SKU, AsciiStrin= gValue) !=3D 0)) { - ComputerSystemCs->SKU =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->SKU =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1168,8 +1186,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"SerialNumber", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SerialNumber, A= sciiStringValue) !=3D 0)) { - ComputerSystemCs->SerialNumber =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->SerialNumber =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1181,8 +1199,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"SubModel", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SubModel, Ascii= StringValue) !=3D 0)) { - ComputerSystemCs->SubModel =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->SubModel =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1194,8 +1212,8 @@ ProvisioningComputerSystemProperties ( AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, RESOURCE= _SCHEMA_VERSION, L"SystemType", ConfigureLang); if (AsciiStringValue !=3D NULL) { if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->SystemType, Asc= iiStringValue) !=3D 0)) { - ComputerSystemCs->SystemType =3D AsciiStringValue; - PropertyChanged =3D TRUE; + ComputerSystemCsEmpty->SystemType =3D AsciiStringValue; + PropertyChanged =3D TRUE; } } } @@ -1212,14 +1230,24 @@ ProvisioningComputerSystemProperties ( // Status =3D JsonStructProtocol->ToJson ( JsonStructProtocol, - (EFI_REST_JSON_STRUCTURE_HEADER *)Compute= rSystem, + (EFI_REST_JSON_STRUCTURE_HEADER *)Compute= rSystemEmpty, 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; } =20 + if (PropertyChanged) { + // Remove Redfish unchangeable properties. + Status =3D RedfishRemoveUnchangeableProperties (ResultJson); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable proper= ties from ResultJson.\n", __func__)); + *ResultJson =3D NULL; + return Status; + } + } + // // Release resource. // @@ -1228,6 +1256,17 @@ ProvisioningComputerSystemProperties ( (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem ); =20 + // + // Free memory allocated for Computersystem empty CS + // + if (ComputerSystemCsEmpty->Boot->BootOrder !=3D NULL) { + DestoryRedfishCharArray (ComputerSystemCsEmpty->Boot->BootOrder, Array= Size); + } + + JsonStructProtocol->DestoryStructure ( + JsonStructProtocol, + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystemEm= pty + ); return (PropertyChanged ? EFI_SUCCESS : EFI_NOT_FOUND); } =20 @@ -1239,6 +1278,7 @@ ProvisioningComputerSystemResource ( ) { CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STATUS Status; EFI_STRING NewResourceLocation; CHAR8 *EtagStr; @@ -1260,13 +1300,45 @@ 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; } =20 + // + // Check and see if platform has OEM data or not + // + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + // + // Check and see if platform has addendum data or not + // + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + Status =3D 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; } =20 @@ -1279,16 +1351,12 @@ ProvisioningComputerSystemResource ( RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); } =20 - // - // Handle Etag - // +RELEASE_RESOURCE: + if (EtagStr !=3D NULL) { - SetEtagWithUri (EtagStr, NewResourceLocation); FreePool (EtagStr); } =20 -RELEASE_RESOURCE: - if (NewResourceLocation !=3D NULL) { FreePool (NewResourceLocation); } @@ -1315,7 +1383,7 @@ ProvisioningComputerSystemResources ( =20 Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHE= MA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangLi= st); if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count =3D=3D 0)) { - DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure languag= e: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); + DEBUG ((DEBUG_ERROR, "%a: No HII question found with configure languag= e: %s: %r\n", __func__, REDPATH_ARRAY_PATTERN, Status)); return EFI_NOT_FOUND; } =20 @@ -1341,14 +1409,13 @@ ProvisioningComputerSystemExistResource ( { EFI_STATUS Status; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; CHAR8 *Json; + CHAR8 *JsonWithAddendum; =20 if (Private =3D=3D NULL) { return EFI_INVALID_PARAMETER; } =20 - EtagStr =3D NULL; Json =3D NULL; ConfigureLang =3D NULL; =20 @@ -1367,29 +1434,55 @@ ProvisioningComputerSystemExistResource ( ); if (EFI_ERROR (Status)) { if (Status =3D=3D 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 =3D EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s fail= ed: %r\n", __func__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: provisioning existing resource for %s fail= ed: %r\n", __func__, ConfigureLang, Status)); } =20 goto ON_RELEASE; } =20 - 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 =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func_= _, ConfigureLang, Status)); + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; } =20 // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr !=3D NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource for %s\= n", __func__, ConfigureLang)); + + // + // PUT back to instance + // + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func_= _, ConfigureLang, Status)); } =20 ON_RELEASE: @@ -1458,7 +1551,7 @@ RedfishCheckResourceCommon ( } =20 // - // 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)) { // @@ -1470,12 +1563,12 @@ RedfishCheckResourceCommon ( =20 Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, RESOU= RCE_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; } =20 if (Count =3D=3D 0) { - return EFI_NOT_FOUND; + return EFI_UNSUPPORTED; } =20 Status =3D EFI_SUCCESS; @@ -1485,9 +1578,9 @@ RedfishCheckResourceCommon ( continue; } =20 - DEBUG ((DEBUG_MANAGEABILITY, "%a, [%d] check attribute for: %s\n", __f= unc__, Index, Property)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: [%d] check attribute for: %s\n", __f= unc__, 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 =3D EFI_NOT_FOUND; } } @@ -1515,14 +1608,13 @@ RedfishUpdateResourceCommon ( { EFI_STATUS Status; CHAR8 *Json; + CHAR8 *JsonWithAddendum; EFI_STRING ConfigureLang; - CHAR8 *EtagStr; =20 if ((Private =3D=3D NULL) || IS_EMPTY_STRING (InputJson)) { return EFI_INVALID_PARAMETER; } =20 - EtagStr =3D NULL; Json =3D NULL; ConfigureLang =3D NULL; =20 @@ -1541,29 +1633,55 @@ RedfishUpdateResourceCommon ( ); if (EFI_ERROR (Status)) { if (Status =3D=3D EFI_NOT_FOUND) { - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s ignored. No= thing changed\n", __func__, ConfigureLang)); + DEBUG ((DEBUG_MANAGEABILITY, "%a: update resource for %s ignored. No= thing changed\n", __func__, ConfigureLang)); + Status =3D EFI_SUCCESS; } else { - DEBUG ((DEBUG_ERROR, "%a, update resource for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); + DEBUG ((DEBUG_ERROR, "%a: update resource for %s failed: %r\n", __fu= nc__, ConfigureLang, Status)); } =20 goto ON_RELEASE; } =20 - DEBUG ((REDFISH_DEBUG_TRACE, "%a, update resource for %s\n", __func__, C= onfigureLang)); // - // PUT back to instance + // Check and see if platform has OEM data or not // - Status =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, &EtagStr); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __func_= _, ConfigureLang, Status)); + Status =3D RedfishGetOemData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; } =20 // - // Handle Etag + // Check and see if platform has addendum data or not // - if (EtagStr !=3D NULL) { - SetEtagWithUri (EtagStr, Private->Uri); - FreePool (EtagStr); + Status =3D RedfishGetAddendumData ( + Private->Uri, + RESOURCE_SCHEMA, + RESOURCE_SCHEMA_VERSION, + Json, + &JsonWithAddendum + ); + if (!EFI_ERROR (Status) && (JsonWithAddendum !=3D NULL)) { + FreePool (Json); + Json =3D JsonWithAddendum; + JsonWithAddendum =3D NULL; + } + + DEBUG ((REDFISH_DEBUG_TRACE, "%a: update resource for %s\n", __func__, C= onfigureLang)); + + // + // PUT back to instance + // + Status =3D CreatePayloadToPatchResource (Private->RedfishService, Privat= e->Payload, Json, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: patch resource for %s failed: %r\n", __func_= _, ConfigureLang, Status)); } =20 ON_RELEASE: @@ -1604,11 +1722,12 @@ RedfishIdentifyResourceCommon ( if (Supported) { Status =3D RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SC= HEMA, RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigLangList); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, RedfishFeatureGetUnifiedArrayTypeConfigure= Lang failed: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: RedfishFeatureGetUnifiedArrayTypeConfigure= Lang failed: %r\n", __func__, Status)); return Status; } =20 if (ConfigLangList.Count =3D=3D 0) { + DEBUG ((DEBUG_MANAGEABILITY, "%a: No platform Redfish ConfigureLang= found for %s\n", __func__, Private->Uri)); return EFI_SUCCESS; } =20 diff --git a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSy= stemDxe.c b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSys= temDxe.c index 04ff5c8270..174a8176a8 100644 --- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .c +++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe= .c @@ -15,7 +15,7 @@ extern REDFISH_RESOURCE_COMMON_PRIVATE *mRedfishResource= Private; extern EFI_HANDLE mRedfishResourceConfigProtocolHand= le; =20 /** - Provisioning redfish resource by given URI. + Provision redfish resource by given URI. =20 @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCOL = instance. @param[in] Uri Target URI to create resource. @@ -42,7 +42,7 @@ RedfishResourceProvisioningResource ( return EFI_INVALID_PARAMETER; } =20 - 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"))); =20 Private =3D REDFISH_RESOURCE_COMMON_PRIVATE_DATA_FROM_RESOURCE_PROTOCOL = (This); =20 @@ -53,7 +53,7 @@ RedfishResourceProvisioningResource ( ZeroMem (&Response, sizeof (Response)); Status =3D RedfishHttpGetResource (Private->RedfishService, Uri, &Respon= se, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, U= ri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, U= ri)); return Status; } =20 @@ -62,6 +62,14 @@ RedfishResourceProvisioningResource ( ASSERT (Private->Payload !=3D NULL); =20 Status =3D 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); + } =20 // // Release resource @@ -73,7 +81,6 @@ RedfishResourceProvisioningResource ( Response.Headers, Response.Payload ); - RedfishHttpResetResource (Uri); Private->Payload =3D NULL; } =20 @@ -118,7 +125,7 @@ RedfishResourceConsumeResource ( ZeroMem (&Response, sizeof (Response)); Status =3D RedfishHttpGetResource (Private->RedfishService, Uri, &Respon= se, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, U= ri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, U= ri)); return Status; } =20 @@ -137,6 +144,7 @@ RedfishResourceConsumeResource ( Private->Uri =3D PendingSettingUri; ExpectedResponse =3D &PendingSettingResponse; } else { + DEBUG ((REDFISH_DEBUG_TRACE, "%a: No @Redfish.Settings is found\n", __= func__)); Private->Uri =3D Uri; ExpectedResponse =3D &Response; } @@ -154,16 +162,14 @@ RedfishResourceConsumeResource ( GetHttpResponseEtag (ExpectedResponse, &Etag); Status =3D RedfishConsumeResourceCommon (Private, Private->Json, Etag); if (EFI_ERROR (Status)) { - if (Status !=3D 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 !=3D 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 !=3D NULL) { + FreePool (Etag); } =20 // @@ -196,10 +202,6 @@ RedfishResourceConsumeResource ( Private->Json =3D NULL; } =20 - if (Etag !=3D NULL) { - FreePool (Etag); - } - return Status; } =20 @@ -269,7 +271,7 @@ RedfishResourceUpdate ( ZeroMem (&Response, sizeof (Response)); Status =3D RedfishHttpGetResource (Private->RedfishService, Uri, &Respon= se, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, U= ri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, U= ri)); return Status; } =20 @@ -282,7 +284,12 @@ RedfishResourceUpdate ( =20 Status =3D 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", __f= unc__, Uri, Status)); + } else { + // + // Get latest ETag on URI and keep it in variable. + // + SetEtagFromUri (Private->RedfishService, Private->Uri, TRUE); } =20 // @@ -342,7 +349,7 @@ RedfishResourceCheck ( ZeroMem (&Response, sizeof (Response)); Status =3D RedfishHttpGetResource (Private->RedfishService, Uri, &Respon= se, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, U= ri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, U= ri)); return Status; } =20 @@ -360,12 +367,16 @@ RedfishResourceCheck ( GetHttpResponseEtag (&Response, &Etag); Status =3D 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)); } =20 // // Release resource // + if (Etag !=3D NULL) { + FreePool (Etag); + } + if (Private->Payload !=3D NULL) { RedfishFreeResponse ( Response.StatusCode, @@ -419,7 +430,7 @@ RedfishResourceIdentify ( ZeroMem (&Response, sizeof (Response)); Status =3D RedfishHttpGetResource (Private->RedfishService, Uri, &Respon= se, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, get resource from: %s failed\n", __func__, U= ri)); + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, U= ri)); return Status; } =20 @@ -432,7 +443,7 @@ RedfishResourceIdentify ( =20 Status =3D RedfishIdentifyResourceCommon (Private, Private->Json); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, identify %s failed: %r\n", __func__, Uri, St= atus)); + DEBUG ((DEBUG_ERROR, "%a: identify %s failed: %r\n", __func__, Uri, St= atus)); } =20 // @@ -570,7 +581,7 @@ EfiRestJasonStructureProtocolIsReady ( (VOID **)&mRedfishResourcePrivate->JsonStructProtocol ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to locate gEfiRestJsonStructureProtoc= olGuid: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a: failed to locate gEfiRestJsonStructureProtoc= olGuid: %r\n", __func__, Status)); } =20 gBS->CloseEvent (Event); @@ -645,7 +656,6 @@ RedfishResourceUnload ( @param[in] SystemTable A pointer to the EFI System Table. =20 @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_ACCESS_DENIED EFI_ISCSI_INITIATOR_NAME_PROTOCOL was inst= alled unexpectedly. @retval Others Other errors as indicated. **/ EFI_STATUS --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-