diff options
author | Konstantin Aladyshev <aladyshev22@gmail.com> | 2023-07-04 12:59:34 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-07-11 18:03:27 +0300 |
commit | 9bb0a7fe3c5dd3c3c9056dec7a37896af347912b (patch) | |
tree | f8067250ab83b7af9be41348349286f50e9374aa /redfish-core/lib/pcie.hpp | |
parent | d7043b3aeb9029321be973f1affd037c3743202c (diff) | |
download | bmcweb-9bb0a7fe3c5dd3c3c9056dec7a37896af347912b.tar.xz |
Correct type for the lanesInUse property
According to the phosphor-dbus-interfaces 'LanesInUse' property in the
PCIeDevice interface has a 'size_t' type. But the current bmcweb code
uses 'int64_t' for that variable in the 'unpackPropertiesNoThrow' call.
This causes function to fail. Correct variable type to fix the issue.
Tested: validator passed
Before:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "Bus_c3_Device_00",
"Manufacturer": "Intel Corporation",
"Model": "",
"Name": "PCIe Device",
"PartNumber": "",
"SerialNumber": "",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The request failed due to an internal service
error. The service is still operational.",
"MessageArgs": [],
"MessageId": "Base.1.16.0.InternalError",
"MessageSeverity": "Critical",
"Resolution": "Resubmit the request. If the problem persists,
consider resetting the service."
}
],
"code": "Base.1.16.0.InternalError",
"message": "The request failed due to an internal service error.
The service is still operational."
}
}
After:
redfish/v1/Systems/system/PCIeDevices/Bus_c3_Device_00
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/
Bus_c3_Device_00",
"@odata.type": "#PCIeDevice.v1_9_0.PCIeDevice",
"Id": "Bus_c3_Device_00",
"Manufacturer": "Intel Corporation",
"Model": "",
"Name": "PCIe Device",
"PCIeFunctions": {
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/
Bus_c3_Device_00/PCIeFunctions"
},
"PCIeInterface": {
"DeviceType": "MultiFunction",
"LanesInUse": 4,
"PCIeType": "Gen3"
},
"PartNumber": "",
"SerialNumber": "",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
Change-Id: I3c7cda6027814ded5e85cfe3d37dbac1bbbc2044
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'redfish-core/lib/pcie.hpp')
-rw-r--r-- | redfish-core/lib/pcie.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp index e10ba64643..40fcd412cb 100644 --- a/redfish-core/lib/pcie.hpp +++ b/redfish-core/lib/pcie.hpp @@ -415,7 +415,7 @@ inline void addPCIeDeviceProperties( { const std::string* deviceType = nullptr; const std::string* generationInUse = nullptr; - const int64_t* lanesInUse = nullptr; + const size_t* lanesInUse = nullptr; const bool success = sdbusplus::unpackPropertiesNoThrow( dbus_utils::UnpackErrorPrinter(), pcieDevProperties, "DeviceType", |