From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id AD92CD801B3 for ; Fri, 26 Jan 2024 02:18:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=KR26HRUjq6glBgP7RuSz/h7rFxVhr74hroxZgwVynq8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706235484; v=1; b=w9VWa9hM5Ge1vZ8T6iSIhmTrVOL2vDLN06XIrJuF8mfst0G1w/yJdXQsrWSddwxkJjA/ZHZ5 jR1TDXukrfLmbA56R14bCbI9+rBN91K3RYoI/sf01RRNsL93ws1Z0NyTyAaurL8n27buPk3tIj1 VBToDmQWHVwFL+sijtgwoeQc= X-Received: by 127.0.0.2 with SMTP id wS9uYY7687511xWOm63NaKcG; Thu, 25 Jan 2024 18:18:04 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.74]) by mx.groups.io with SMTP id smtpd.web11.6097.1706235483572794552 for ; Thu, 25 Jan 2024 18:18:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eN8ilMZMVydSMYYUfM+EfH8wrN0yWBwjjK6s7KUngiRsBfAOjKkfUjbpmGaHtR1LGQecAxD0Iz3BGGNPtRsWqMz0p0HBtrkMOQHsDH+HZR99mCLpV1gtJPYVwXB0AMaDPyVmlkNi6Yz5M+tS08w3/UIq1yrCP3u172FPvs3t6NdakYHzprDKpELVvdOxa2UuNClWWn2zOFgsqNLhO3vbXek9AbyiiaLDeAnSVnbwZ1mb5iaP8AcV7BvPoWtEVSwq0nmM4PkyDhNIppwwZUd6O1zFxOxH1bmBzpC8bcHDbwvNUtGBM6xWZMChaMV0Fhr4NvEY6YJRHzfcnNykDWE9DQ== 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=ppVWUNU7gyVFCuzFYeftZx61Q9f3k7C9sFhOpjc0Af0=; b=ndHeaDyTqw567Ob8Mwu+fHCCDfDVILuRLQM10L5OraPm/qJYgFXZcjaf4BbgpX5ZRcb+DVgEg6UiSHVwIrgjdQ3GpUFtFhtHDqQTAYVKm/G71BmuEPzSHRHl3TOaCObW+qZxGUjuwYOpJ+dWkvFyfDyigpJ+57AZ1QK5hqhRwb4vNu8yL1uGVP2zh0AxJpTsI6CsANi/qN+uJD4IEMw6s46HRpxOqZYnDRpz+U9bqFvLGb8hwZ9R2SoumDMYSNhWWTwHiXVYjupsc/ZQv8QwEhY2dz3NLzlKSV7n9xpBRZJsnFQwNdR63SYb/pg1x/FUwuOqaKFmv6Ko5V/PLm396w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by BY5PR12MB4856.namprd12.prod.outlook.com (2603:10b6:a03:1d5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.24; Fri, 26 Jan 2024 02:17:57 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::aa79:3ab0:fbcd:d61b]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::aa79:3ab0:fbcd:d61b%5]) with mapi id 15.20.7228.027; Fri, 26 Jan 2024 02:17:56 +0000 From: "Nickle Wang via groups.io" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver Thread-Topic: [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver Thread-Index: AQHaT/Uc/qns3qwxUUCQhPQCiSanebDrWnsg Date: Fri, 26 Jan 2024 02:17:56 +0000 Message-ID: References: <20240126011447.1814-1-abner.chang@amd.com> In-Reply-To: <20240126011447.1814-1-abner.chang@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|BY5PR12MB4856:EE_ x-ms-office365-filtering-correlation-id: f724d50a-8621-4d28-229c-08dc1e1502bc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 8NXHmUaVJPCUwPS+u0+s9rTFd6e/xMJNkzaapFBbXbikNpwFbKcE3BbbddtNlg58S0v8+SuncNXzQuMg9CWLxraojX/jM09HbTKJwhLw/PNyYJrE8xveMZIOn9f6ESmQHttbrf8QYWH/9ofPomRoKqppaBp6G1JDElzBHLCm6J7iKY2fhWWF1qPhEpo/btDtBPrHh5D/A6Q82wHd5RxeKuh5fYn6pSQjUvClPDnwM8Aari49byIjv7q0objEl6q7/cJKjCAepuVCkN8ShRz9ohzH8s1O2/jFWpJDAdyoN4j1xrusRHAHxDgn9pmdM9ujvLPpaX4aUv20PrblWkSSKM2ZH1HY++3W/ktxhvB3LdqSOfibqqVAjbMUDuxu5eXantceLjx7TWFyOMCu1pditP//Wk3hSKUBTJUMkS7n67ipZ02c2BiUABuSrNjk0DAFTQY7888yOtsxWFLIZJXZrrl1LP5o2dUwbzRmFRcYnODacI5TsdwTIIMltzuROHUCGdfycKTAioedR+k7wm67cHSWTtbQyHm+ZZ3Ir5dxnIwdQg91ApYyEWaWl8L2fuxzy/i2PciOMrHQ2HOvMr5+qz8YAIJGtC0h0e4tAip3fZRGKc1bc7eTtKx7+yutoWW8dklyqE3y9fP/344jCN92JJZGGmvxRop5gidVjKveUPkDZsJxj3W7V1llcOS/Q81u x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WGs3CX+NuvhJKk2TM74CKfLmNHaNbbRVkW18mXWtm0HXW+D8k9MwSKiAxEWu?= =?us-ascii?Q?nCshgEuDu+25/a+jZVaOdRYcG41i8/armvZHnEabMIOKjPRm4tGW28eV3Ppt?= =?us-ascii?Q?/hPixk9SZMmrVcRXOtNCYm3rjFc7DGuaQrS7SkCb7ULtEHQLpCBcHiJ8ZrPP?= =?us-ascii?Q?XgN6aa6k1ixXSoHPxTbNpCx9j+O2dvaAKubBcGGA706gfW/aM6Y6QmK2fvuz?= =?us-ascii?Q?UJ234I9xuo9mkVmQD3P2C+Q1SHXrMctujn/Bswzy14BAYgUHtHx3pvMoCvRp?= =?us-ascii?Q?Nxc5oIiTAonFyCNuubCGRzomt/Jonlr67DL1ytmH3A6Es3jHDrJPAGbrkOoz?= =?us-ascii?Q?NEQCqPalMtV4tOLkXGr/h3ummsiqu7pklZGjMPLLFQsCzQF5p5OQlUBo//aH?= =?us-ascii?Q?RpQYu0eXeL4tVwdjdb1+5nEvNmPlBPS1UIJctYk34HgDqxc6eZcdgFCITlRE?= =?us-ascii?Q?XVJl/GunqZDbwbklUgjSw0ttpFyHUsFWLs7exRCVUVdtVIKVy0/V23lndZ3w?= =?us-ascii?Q?HkbWz4wS4qlg5mCM3+ooOmaV2mkdGfHZqfmQ/UPMVFLeSwPnW1R+uHTppM/i?= =?us-ascii?Q?tOcMlgIzrWBHoAq5TR4O9G4RkXNv7orSSTQYgIFEvpAohknTCzYMoyii16GQ?= =?us-ascii?Q?HDebhyuzVDFpJi6B1aNI/OyvuM2d/7Bd1NC/tl3NsgpX3aRCHMJ6+XEyQNkA?= =?us-ascii?Q?9K00ULC3j9N3m/rn4mcaMIUZpgoyoHD6yBPu0vJ/EA6S7YK42xy4A+Bs9cCa?= =?us-ascii?Q?tAhNH3YDrTJj81bqX+gWX4dPZFtBzrk+Um7kVVcUxRTi4hxTzmw1eEJl8UIX?= =?us-ascii?Q?ahF9pnV3diiQfk4Lup+bi2wy79cMCDEC0msYIZ3Se4LfhW2eLVbqwQEKOWg0?= =?us-ascii?Q?T03HhKhb+QyadUAP40QG7PHvH4bVuU1Xzyfkc8g86m725Ef5fmcDjLNZkMiq?= =?us-ascii?Q?Pg/6N8JSRzq9cNId418hsRcpTZGiUPJvbJ6l4RDHEFQRumISloEgwDZQpog4?= =?us-ascii?Q?cki4TF35ctXgY7dFFazJKZ/qF9rGBQpybpLA8TLotv7a6wOswtm5EU5WU3qw?= =?us-ascii?Q?1AcYAb7ePGFjfEaqit4z4XE8291oVBN5HZo9FZEtJWzhQn4JwHW95qxKDl9U?= =?us-ascii?Q?R9gZO4FJzX43WI+KXxVHY0otl0I0rg4w1RghZqroS5exefgbYGEBm1NXgw4g?= =?us-ascii?Q?4Zt85vc0A/45FIXh2Vw/ao8Vt6etUlWW2uJhtCJ8rfgzVaFTBN3V7yadi8Kz?= =?us-ascii?Q?E0xsZbaS+kU7g5nhTD8Z0GuFu8/GzJ9ONFgYLB+VcMrqHSLxMG0qhudhfNua?= =?us-ascii?Q?OnynmX1F23eVfz5xRrD8K8B6FJICa0qW5OmdF67taGtYEpMqG6nNL4zChVig?= =?us-ascii?Q?LtYA+4oof8b1rYSzfntRrCfYckuCw+rmy2QT1zBBIFvNc6cVqxwC0/dqh3BY?= =?us-ascii?Q?v8fsfzol9qdlqiuPrzwRSmLPcSWmohIrcY96U0UHssXX0x0z0R3HX5+yuUNo?= =?us-ascii?Q?gkAkySPsipwzdV3w3Rjza9QrGSkycvNH8K1Y5fjOB2LdG2fjB0Nd12xNvgd4?= =?us-ascii?Q?GBdkKM2H0GMHJLLiGBJ2RxxvDslftJk+LYxTxiFSw4ArV7UHlLV7uVsI0CEw?= =?us-ascii?Q?McWnsrHkKcsdGxy3d+WPN+BmvEyRZV9fiw2uSv1u90TX?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f724d50a-8621-4d28-229c-08dc1e1502bc X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jan 2024 02:17:56.8228 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VWxnnXgBRhJ3gf7a/bv1+qk32B9YUvYUqUWC3qEU2DAdSij0FcdWsB/01sqRqk/PIUrTYQwJxb+166g38WPXSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4856 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3Uvf4O1ekIYAnl8QqDnBTx9ux7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=w9VWa9hM; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Abner, I found one minor issue: > if (ConfigLangList.Count =3D=3D 0) { > + DEBUG ((DEBUG_MANAGEABILITY, " No platform Redfish ConfigureLang > + found for %s\n", __func__, Private->Uri)); > return EFI_SUCCESS; "%a:" is missing above. Regards, Nickle > -----Original Message----- > From: abner.chang@amd.com > Sent: Friday, January 26, 2024 9:15 AM > To: devel@edk2.groups.io > Cc: Nickle Wang ; Igor Kulchytskyy > Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: > ComputerSystem_1_5_0 driver >=20 > External email: Use caution opening links or attachments >=20 >=20 > From: Abner Chang >=20 > Update Redfish ComputerSystem_1_5_0 feature driver to align the > implementation with latest code. This driver handles all of ComputerSyste= m > v1_5_0 properties and incorporate with Redfish simualtor. >=20 > Signed-off-by: Abner Chang > Cc: Nickle Wang > Cc: Igor Kulchytskyy > --- > .../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(-) >=20 > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.inf > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.inf > index 36cbe06211..4e7dc5c7c5 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.inf > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > +++ Dxe.inf > @@ -37,6 +37,7 @@ > RedfishResourceIdentifyLib > UefiLib > UefiDriverEntryPoint > + RedfishAddendumLib > RedfishHttpCacheLib >=20 > [Protocols] > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste > mCommon.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste > mCommon.c > index 3ace03bd4c..7cd2a6f378 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste > mCommon.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSys > +++ temCommon.c > @@ -53,7 +53,7 @@ RedfishConsumeResourceCommon ( > (EFI_REST_JSON_STRUCTURE_HEADE= R > **)&ComputerSystem > ); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Sta= tus)); > + DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, > + Status)); > return Status; > } >=20 > @@ -66,8 +66,8 @@ RedfishConsumeResourceCommon ( > // > // No change > // > - DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore > consume action\n", __func__, Private->Uri)); > - Status =3D EFI_ALREADY_STARTED; > + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore > consume 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, > 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)); > } >=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- > >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)); > } >=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- > >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)); > } >=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- > >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)); > } >=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__, Stat= us)); > + DEBUG ((DEBUG_ERROR, "%a: ToStructure failure: %r\n", __func__, Stat= us)); > + return Status; > + } > + > + ComputerSystemEmpty =3D NULL; > + Status =3D JsonStructProtocol->ToStructure ( > + JsonStructProtocol, > + NULL, > + ComputerSystemEmptyJson, > + (EFI_REST_JSON_STRUCTURE_H= EADER > **)&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 > + (ResourceId), 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, > AsciiStringValue) !=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, > AsciiStringValue) !=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, > RESOURCE_SCHEMA_VERSION, L"Boot/BootNext", ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot->BootN= ext, > 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_SC= HEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootOrder", ConfigureLang, &ArraySize); > if (AsciiStringArrayValue !=3D NULL) { > if (ProvisionMode || !CompareRedfishStringArrayValues > (ComputerSystemCs->Boot->BootOrder, AsciiStringArrayValue, ArraySize)) { > - AddRedfishCharArray (&ComputerSystemCs->Boot->BootOrder, > AsciiStringArrayValue, ArraySize); > + AddRedfishCharArray (&ComputerSystemCsEmpty->Boot->BootOrder, > + AsciiStringArrayValue, ArraySize); > PropertyChanged =3D TRUE; > } > } > @@ -854,8 +872,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideEnabled", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideEnabled, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->Boot->BootSourceOverrideEnabled =3D > AsciiStringValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->Boot->BootSourceOverrideEnabled =3D > AsciiStringValue; > + PropertyChanged =3D TRU= E; > } > } > } > @@ -867,8 +885,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideMode", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideMode, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->Boot->BootSourceOverrideMode =3D AsciiString= Value; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->Boot->BootSourceOverrideMode =3D > AsciiStringValue; > + PropertyChanged =3D TRUE; > } > } > } > @@ -880,8 +898,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/BootSourceOverrideTarget", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot- > >BootSourceOverrideTarget, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->Boot->BootSourceOverrideTarget =3D AsciiStri= ngValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->Boot->BootSourceOverrideTarget =3D > AsciiStringValue; > + PropertyChanged =3D TRUE= ; > } > } > } > @@ -893,8 +911,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"Boot/UefiTargetBootSourceOverride", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->Boot- > >UefiTargetBootSourceOverride, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->Boot->UefiTargetBootSourceOverride =3D > AsciiStringValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->Boot->UefiTargetBootSourceOverride =3D > AsciiStringValue; > + PropertyChanged =3D = TRUE; > } > } > } > @@ -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, > AsciiStringValue) !=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- > >FunctionEnabled !=3D *BooleanValue)) { > IntegerValue =3D AllocatePool (sizeof (*IntegerValue)); > if (IntegerValue !=3D NULL) { > - *IntegerValue =3D (Bo= oleanValue ? 0x01 : 0x00); > - ComputerSystemCs->HostWatchdogTimer->FunctionEnabled =3D > IntegerValue; > - PropertyChanged =3D TRU= E; > + *IntegerValue = =3D (BooleanValue ? 0x01 : 0x00); > + ComputerSystemCsEmpty->HostWatchdogTimer->FunctionEnabled = =3D > IntegerValue; > + PropertyChanged = =3D TRUE; > } > } > } > @@ -941,8 +959,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/TimeoutAction", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs- > >HostWatchdogTimer->TimeoutAction, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->HostWatchdogTimer->TimeoutAction =3D > AsciiStringValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->HostWatchdogTimer->TimeoutAction =3D > AsciiStringValue; > + PropertyChanged =3D TR= UE; > } > } > } > @@ -954,8 +972,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"HostWatchdogTimer/WarningAction", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs- > >HostWatchdogTimer->WarningAction, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->HostWatchdogTimer->WarningAction =3D > AsciiStringValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->HostWatchdogTimer->WarningAction =3D > AsciiStringValue; > + PropertyChanged =3D TR= UE; > } > } > } > @@ -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, > AsciiStringValue) !=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, > AsciiStringValue) !=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, > RESOURCE_SCHEMA_VERSION, L"MemorySummary/MemoryMirroring", > ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->MemorySumma= ry- > >MemoryMirroring, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->MemorySummary->MemoryMirroring =3D > AsciiStringValue; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->MemorySummary->MemoryMirroring =3D > AsciiStringValue; > + 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- > >TotalSystemMemoryGiB !=3D *NumericValue)) { > - ComputerSystemCs->MemorySummary->TotalSystemMemoryGiB =3D > NumericValue; > - PropertyChanged =3D TRUE= ; > + ComputerSystemCsEmpty->MemorySummary->TotalSystemMemoryGiB =3D > NumericValue; > + PropertyChanged =3D= TRUE; > } > } > } > @@ -1037,8 +1055,8 @@ ProvisioningComputerSystemProperties ( > NumericValue =3D GetPropertyNumericValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, > L"MemorySummary/TotalSystemPersistentMemoryGiB", ConfigureLang); > if (NumericValue !=3D NULL) { > if (ProvisionMode || (*ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB !=3D *NumericValue)) { > - ComputerSystemCs->MemorySummary- > >TotalSystemPersistentMemoryGiB =3D NumericValue; > - PropertyChanged = =3D TRUE; > + ComputerSystemCsEmpty->MemorySummary- > >TotalSystemPersistentMemoryGiB =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, > AsciiStringValue) !=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, > AsciiStringValue) !=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, > AsciiStringValue) !=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 NumericValu= e; > + 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- > >LogicalProcessorCount !=3D *NumericValue)) { > - ComputerSystemCs->ProcessorSummary->LogicalProcessorCount =3D > NumericValue; > - PropertyChanged =3D = TRUE; > + ComputerSystemCsEmpty->ProcessorSummary->LogicalProcessorCount= =3D > NumericValue; > + PropertyChanged = =3D TRUE; > } > } > } > @@ -1134,8 +1152,8 @@ ProvisioningComputerSystemProperties ( > AsciiStringValue =3D GetPropertyStringValue (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, L"ProcessorSummary/Model", ConfigureLang); > if (AsciiStringValue !=3D NULL) { > if (ProvisionMode || (AsciiStrCmp (ComputerSystemCs->ProcessorSu= mmary- > >Model, AsciiStringValue) !=3D 0)) { > - ComputerSystemCs->ProcessorSummary->Model =3D AsciiStringValue= ; > - PropertyChanged =3D TRUE; > + ComputerSystemCsEmpty->ProcessorSummary->Model =3D AsciiString= Value; > + 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, > AsciiStringValue) !=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, > AsciiStringValue) !=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, > AsciiStringValue) !=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, > AsciiStringValue) !=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 *)Compu= terSystem, > + (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; > } >=20 > + if (PropertyChanged) { > + // Remove Redfish unchangeable properties. > + Status =3D RedfishRemoveUnchangeableProperties (ResultJson); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Fail to remove Redfish unchangeable > properties 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, > + ArraySize); } > + > + JsonStructProtocol->DestoryStructure ( > + JsonStructProtocol, > + (EFI_REST_JSON_STRUCTURE_HEADER *)ComputerSystem= Empty > + ); > 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, Priva= te- > >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_SCHEMA, RESOURCE_SCHEMA_VERSION, > REDPATH_ARRAY_PATTERN, &UnifiedConfigureLangList); > if (EFI_ERROR (Status) || (UnifiedConfigureLangList.Count =3D=3D 0)) { > - DEBUG ((DEBUG_ERROR, "%a, No HII question found with configure langu= age: > %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; > } >=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 f= or %s > ignored. Nothing changed\n", __func__, ConfigureLang)); > + DEBUG ((DEBUG_MANAGEABILITY, "%a: provisioning existing resource f= or > %s ignored. Nothing changed\n", __func__, ConfigureLang)); > + Status =3D EFI_SUCCESS; > } else { > - DEBUG ((DEBUG_ERROR, "%a, provisioning existing resource for %s fa= iled: > %r\n", __func__, ConfigureLang, Status)); > + DEBUG ((DEBUG_ERROR, "%a: provisioning existing resource for %s > + failed: %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, Priv= ate- > >Payload, Json, &EtagStr); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __fun= c__, > 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, > + Private->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, > RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, &ConfigureLangList, > &Count); > if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang fail= ed: > %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", > __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 =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. > Nothing changed\n", __func__, ConfigureLang)); > + DEBUG ((DEBUG_MANAGEABILITY, "%a: update resource for %s ignored. > Nothing changed\n", __func__, ConfigureLang)); > + Status =3D 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)); > } >=20 > goto ON_RELEASE; > } >=20 > - 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 =3D CreatePayloadToPatchResource (Private->RedfishService, Priv= ate- > >Payload, Json, &EtagStr); > - if (EFI_ERROR (Status)) { > - DEBUG ((DEBUG_ERROR, "%a, patch resource for %s failed: %r\n", __fun= c__, > 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__, ConfigureLang)); > + > + // > + // PUT back to instance > + // > + Status =3D 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)); > } >=20 > ON_RELEASE: > @@ -1604,11 +1722,12 @@ RedfishIdentifyResourceCommon ( > if (Supported) { > Status =3D 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; > } >=20 > if (ConfigLangList.Count =3D=3D 0) { > + DEBUG ((DEBUG_MANAGEABILITY, " 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/ComputerSystemDx > e.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > index 04ff5c8270..174a8176a8 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx > e.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem > +++ Dxe.c > @@ -15,7 +15,7 @@ extern REDFISH_RESOURCE_COMMON_PRIVATE > *mRedfishResourcePrivate; > extern EFI_HANDLE mRedfishResourceConfigProtocolHa= ndle; >=20 > /** > - Provisioning redfish resource by given URI. > + Provision redfish resource by given URI. >=20 > @param[in] This Pointer to EFI_HP_REDFISH_HII_PROTOCO= L > 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, &Resp= onse, > 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; > } >=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, &Resp= onse, > 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; > } >=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, &Resp= onse, > 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; > } >=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", > + __func__, 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, &Resp= onse, > 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; > } >=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, &Resp= onse, > 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; > } >=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, > Status)); > + DEBUG ((DEBUG_ERROR, "%a: identify %s failed: %r\n", __func__, Uri, > + Status)); > } >=20 > // > @@ -570,7 +581,7 @@ 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)); > } >=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 > installed unexpectedly. > @retval Others Other errors as indicated. > **/ > EFI_STATUS > -- > 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 (#114484): https://edk2.groups.io/g/devel/message/114484 Mute This Topic: https://groups.io/mt/103967793/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-