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 E927C7803D9 for ; Tue, 16 Jan 2024 08:31:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=2sgYP60lvf7kdLDOLbKeuqDp1DBgPCV2+TTbF8WZiWM=; 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:msip_labels: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=1705393917; v=1; b=QcVlyyB3UYNu+EueRFMDrr3Qg0NJ1PQCiYuw1dcqS8NVgNUqprWlmKF1n7HJLAsCbu5JbEjm ZtiO66XmXtNyURyAh3w/y5t1yQbF84v1lYIAMWnk4MkC1dCzKj6qz/QlkhohApY1wCQBSyGCVu+ t7CWbawulUxyJXBbmIFrzc0Y= X-Received: by 127.0.0.2 with SMTP id XKLhYY7687511xeVxaMJeK52; Tue, 16 Jan 2024 00:31:57 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.83]) by mx.groups.io with SMTP id smtpd.web11.8519.1705393916705618924 for ; Tue, 16 Jan 2024 00:31:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kPQ759loHrVGZRxYrRB/8kZDN//UQR5rom8jNnr4Gim4fF8ozGlteUXT9QXFQVT0M1x1xsAFeJtEAKF0EtKURNoceBAdQW0IeeiXid/6zBd6UVnsGsWXfOT6uKK19Mb7Xz3GFfENwEHG7VFVvg+J6c+JhfMhEY1PMWgjIP4k4Ng4YFTKq7zbcKou0kj5GJZOWpgWcP0LdTc6KqlWxYK5zlEw54wplEUwRvxxK9yAn9bI/Uh4ZhOz+tX2zmPS6j8EfIgoB1iRY+xuAnN72ztwx6kaDgnXrIyylq/U64z2EI+sIzlfROyLmIB7rgQ+meLqA8ehnBwjs3sjcerz+gpzqw== 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=cD4rVsQcToAqUBKlO2YxwFSpsB5eb+AaTBjdbqxvSms=; b=C925zBeQGQbODXMDdFcbVi52c38kbO+6UTLZZSqy1/LQz8q/krZoSJI8lYNmTxJn1I5h7RxfJDIgp6cOo2YnpXQ8M4EGYhVml0Y9WgmCUBemIJTp9JJCSiTgHcxvBZGinuSH6nGc4+/oEQN1Gb6aXs+LyykSfWeEUP05qPBKT5G8MmsbLdV6gcnLlaXNEuZGFpJRrnYhcF4shJioM+gtgj6jZzvDUThgNCaXXvU1LFpkOQZE6OmPcje0W7muJCke22oretfXgw+KSTg4tuZV1EcoC7MrUieNoLvorNdvu4w8ACKlVbdFNejsbs4IeD9mmHDYgKHoxOgOeq3GsvyQRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by DM4PR12MB5360.namprd12.prod.outlook.com (2603:10b6:5:39f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26; Tue, 16 Jan 2024 08:31:53 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::67bd:f1b9:58a3:d2e6]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::67bd:f1b9:58a3:d2e6%7]) with mapi id 15.20.7159.020; Tue, 16 Jan 2024 08:31:52 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterLib: Function to remove Redfish unchangeable properties Thread-Topic: [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterLib: Function to remove Redfish unchangeable properties Thread-Index: AQHaRQc4HTeiDNjzZUSd1KJIVDmyR7DbylvggAAN14CAACV+MIAAJP3g Date: Tue, 16 Jan 2024 08:31:52 +0000 Message-ID: References: <20240112032622.274-1-abner.chang@amd.com> <20240112032622.274-3-abner.chang@amd.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=12749c01-9a2d-4b55-9ca2-fb359cfe09c7;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-01-16T04:04:39Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|DM4PR12MB5360:EE_ x-ms-office365-filtering-correlation-id: b950d58a-c754-4296-0274-08dc166d978b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: eG6LGU5tpxi7ilGE6UawyhKLTNq5CY2M+93zbiMUotF2LqaMMbztaXluTkN/DPSB010m6s8aq4BTCOkoYUSSEZ8xKAol0hVN2Zro8zqzyVxUwL82cmFaitYF2xLSHIoGuKJwfIQoB0ouW3J3A4XBrOVjBnwmUyuWNgfFzDXNQLzQG3lxKTAbKzRw388XwqwkgtVGMDiccc7cCM/W+oX7qSbaAT4I/DTaGmw8nVfEV0L3uAqWirKY5M6RYaBZaYx+xaPbb+fiYYDDcWErji/qCiacckL+YHxarI5nSyew78RI8st1Y4RA0RR1gYeq+yib2ann+X3TuLYHbedTIs3yuHSWaJxCEQVvTdGggn6w9cYKvDITtbX1WpNIfF0hs/rFAXpSEruV+GRycP4h547TQ8yp8A5TbybNSVbG5XBDUjm61p3DtnbYbeuMLwWyK1Dtm9Ar3j3EcVH0I07kZHCufi2AZySktnRAcP0fNqUKYOc57p6C+OfhKgb6OPU2T1IBq0clKFgto2ZZWTiniNHFnRbSfKoPzMJ+QqSWTvrZZ2p0BpK1qK+cjlko4eXTTemvbg0peAXCxF5cSxZmsBaSKefm3DaWVJecPm4yz7kS5YyQ+Vro+s49weDGDbuLcDi+3JeyG4ZFAH9t26TDwdMngZq4Dv/AW6utiIkw1uUDNoM= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gMyRr0ehV7grxH/izJmiNdn5+sQNsqNH7e1ePQnKqbGiKIG5QnPXRABhFPC0?= =?us-ascii?Q?tNUOm6flfo2LiP437XVek/NsukgqU5AL+f3jAaIhZNVj8FC7iepDGlff+c7x?= =?us-ascii?Q?v8Q7gJ8MSAc7QWae2iLIj/nkhSqlGgrG4WSF81MtxXsJBDm9bhWZy+9FJCK7?= =?us-ascii?Q?SBS0pAbpOz16+6ARTes/8eTRhxPeVPGwlhDz/eyY4gSgNwrba2CeJfoX+lpX?= =?us-ascii?Q?XjoIvEncNngZ0f0Ib9NNhA4HCJthbXoLiShzFaT+/YIKqriP/mXCkZ7urna3?= =?us-ascii?Q?HI+d7D4/WIN6WqToKot8kWeb/uy6CeBjg0CU+WUf+NOHIcgCPmDCbZPGuq+x?= =?us-asc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Apeha5L7pgR1LkR6iblehRuAiVPe?= =?us-ascii?Q?1sxNMYfJ89ytmtFjAAFO2/1kEkfU/Q7KxUNw89dz5WRX02Vy4K94h6LaJGqx?= =?us-ascii?Q?c1LjsM6Ze60FGqLlDwUuZ7wop26USPvho/ZmrDfasLoR1icBdi7EVcsxVjAA?= =?us-ascii?Q?IPr+7Z6f/Db7Kpttp1vbl8RN1u95eyH1SqMIgbPU3MtUDOxOlfX9WkvxzGVJ?= =?us-ascii?Q?T1m11V4SDST69KdEWUKoK5AW8ddHen29zARjlSb1yUHqu8BUXKLDu+HMBcbp?= =?us-ascii?Q?uIau0wlHMPEcUInjeT1WFY7DmghcX8dZljYKufUcWjwhi4nJr9egMLKlY7QX?= =?us-ascii?Q?yX+IqWDY8C56hbfmC9Q=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b950d58a-c754-4296-0274-08dc166d978b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2024 08:31:52.9407 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hhPRg9wK0SlFw82Aqj2ciPbLOLS12JubAHKuTDxRXlbdH36WIPLm6q51vqVSs8+hXJjHrE/HcuI7eqokCJBV4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5360 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: 8EWYJ7Yo6EiOai5c9tWbonqPx7686176AA= 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=QcVlyyB3; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Got it and thanks. I will fix the typo, put your RB then merge this patch. Abner > -----Original Message----- > From: Nickle Wang > Sent: Tuesday, January 16, 2024 2:20 PM > To: Chang, Abner ; devel@edk2.groups.io > Cc: Igor Kulchytskyy > Subject: RE: [edk2-redfish-client][PATCH 3/3] RedfishClientPkg/ConverterL= ib: > Function to remove Redfish unchangeable properties > > [AMD Official Use Only - General] > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > > I didn't choose ReadOnly is because at BIOS perspective as a provider, = we still > > update the read only property defined in schema such as BootOptions. Th= us > I > > thought to use ReadOnly is not quite accurate. How do you think? > > I see. Thanks for your explanation. Please fix the typos and keep the fun= ction > name untouched. > > Regards, > Nickle > > > -----Original Message----- > > From: Chang, Abner > > Sent: Tuesday, January 16, 2024 12:08 PM > > To: Nickle Wang ; devel@edk2.groups.io > > Cc: Igor Kulchytskyy > > Subject: RE: [edk2-redfish-client][PATCH 3/3] > RedfishClientPkg/ConverterLib: > > Function to remove Redfish unchangeable properties > > > > External email: Use caution opening links or attachments > > > > > > [AMD Official Use Only - General] > > > > > -----Original Message----- > > > From: Nickle Wang > > > Sent: Tuesday, January 16, 2024 11:18 AM > > > To: Chang, Abner ; devel@edk2.groups.io > > > Cc: Igor Kulchytskyy > > > Subject: RE: [edk2-redfish-client][PATCH 3/3] > RedfishClientPkg/ConverterLib: > > > Function to remove Redfish unchangeable properties > > > > > > Caution: This message originated from an External Source. Use proper > > > caution when opening attachments, clicking links, or responding. > > > > > > > > > I found typos. Please see below. > > > > > > Regards, > > > Nickle > > > > > > > -----Original Message----- > > > > From: abner.chang@amd.com > > > > Sent: Friday, January 12, 2024 11:26 AM > > > > To: devel@edk2.groups.io > > > > Cc: Nickle Wang ; Igor Kulchytskyy > > > > > > > > Subject: [edk2-redfish-client][PATCH 3/3] > RedfishClientPkg/ConverterLib: > > > > Function to remove Redfish unchangeable properties > > > > > > > > External email: Use caution opening links or attachments > > > > > > > > > > > > From: Abner Chang > > > > > > > > Update RedfishCsCommon.c to add a function to remove Redfish > > > unchangeable > > > > properties. > > > > > > > > Signed-off-by: Abner Chang > > > > Cc: Nickle Wang > > > > Cc: Igor Kulchytskyy > > > > --- > > > > .../ConverterLib/include/RedfishCsCommon.h | 20 +++++++ > > > > .../ConverterLib/src/RedfishCsCommon.c | 55 > +++++++++++++++++++ > > > > 2 files changed, 75 insertions(+) > > > > > > > > diff --git a/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.= h > > > > b/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > > > > index e454ab0b73..f5278015aa 100644 > > > > --- a/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > > > > +++ b/RedfishClientPkg/ConverterLib/include/RedfishCsCommon.h > > > > @@ -104,6 +104,26 @@ DestoryCsMemory ( > > > > RedfishCS_void *rootCs > > > > ); > > > > > > > > +/** > > > > + This function removes the unchangeable Redfish properties from > > > > +JSON raw text > > > > + The content in JsonString is left unmodified, the caller has to > > > > +give enoungh > > > > + memory pointed by NewJsonBuffer in the size of BufferSize. > > > > + > > > > + JsonString Input JSON raw string > > > > + NewJsonBuffer Pointer to memory for the updated JSON raw string= in > > > > + size of BuufferSize. > > > > + BuufferSize The buffer size of NewJsonBuffer > > > > + > > > > + Return RedfishCS_status. > > > > + > > > > +**/ > > > > +RedfishCS_status > > > > +RemoveUnchangeableProperties ( > > > > + RedfishCS_char *JsonString, > > > > + RedfishCS_char *NewJsonBuffer, > > > > + RedfishCS_uint32 BuufferSize > > > > + ); > > > > > > BufferSize. You have double 'u' above. And how about to use ReadOnly > > > instead of "Unchangeable"? > > Thanks for catching the typo. > > > > I didn't choose ReadOnly is because at BIOS perspective as a provider, = we still > > update the read only property defined in schema such as BootOptions. Th= us > I > > thought to use ReadOnly is not quite accurate. How do you think? > > > > Abner > > > > > > > > > > > > + > > > > typedef struct _RedfishCS_char_Array RedfishCS_char_Array= ; > > > > typedef struct _RedfishCS_int64_Array RedfishCS_int64_Arra= y; > > > > typedef struct _RedfishCS_bool_Array RedfishCS_bool_Array= ; > > > > diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > > > > b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > > > > index fd31e5296b..c6996d7d5d 100644 > > > > --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > > > > +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c > > > > @@ -1461,3 +1461,58 @@ CsEmptyPropLinkToJson ( > > > > > > > > return RedfishCS_status_success; > > > > } > > > > + > > > > +/** > > > > + This function removes the unchangeable Redfish properties from > > > > +JSON raw text > > > > + The content in JsonString is left unmodified, the caller has to > > > > +give enoungh > > > > + memory pointed by NewJsonBuffer in the size of BufferSize. > > > > + > > > > + JsonString Input JSON raw string > > > > + NewJsonBuffer Pointer to memory for the updated JSON raw string= in > > > > + size of BuufferSize. > > > > + BuufferSize The buffer size of NewJsonBuffer > > > > + > > > > + Return RedfishCS_status. > > > > + > > > > +**/ > > > > +RedfishCS_status > > > > +RemoveUnchangeableProperties ( > > > > + RedfishCS_char *JsonString, > > > > + RedfishCS_char *NewJsonBuffer, > > > > + RedfishCS_uint32 BuufferSize > > > > + ) > > > > > > > > > BufferSize. You have double 'u' above. > > > > > > > > > > +{ > > > > + json_t *JsonObj; > > > > + RedfishCS_char *TempChar; > > > > + RedfishCS_status Status; > > > > + > > > > + if ((JsonString =3D=3D NULL) || (NewJsonBuffer =3D=3D NULL)) { > > > > + return RedfishCS_status_invalid_parameter; > > > > + } > > > > + > > > > + JsonObj =3D json_loads (JsonString, 0, NULL); if (JsonObj =3D= =3D NULL) { > > > > + return RedfishCS_status_unknown_error; } > > > > + > > > > + json_object_del (JsonObj, "@odata.type"); json_object_del > > > > + (JsonObj, "@odata.id"); json_object_del (JsonObj, "Id"); > > > > + json_object_del (JsonObj, "Name"); > > > > + > > > > + TempChar =3D json_dumps ((json_t *)JsonObj, JSON_INDENT (2)); > > > > + if (TempChar !=3D NULL) { > > > > + if ((strlen (TempChar) + 1) > BuufferSize) { > > > > + Status =3D RedfishCS_status_insufficient_memory; > > > > + } else { > > > > + memcpy (NewJsonBuffer, TempChar, strlen (TempChar) + 1); > > > > + free (TempChar); > > > > + Status =3D RedfishCS_status_success; > > > > + } > > > > + } else { > > > > + Status =3D RedfishCS_status_unknown_error; > > > > + } > > > > + json_decref(JsonObj); > > > > + return 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 (#113879): https://edk2.groups.io/g/devel/message/113879 Mute This Topic: https://groups.io/mt/103676920/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-