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>
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index e10ba64..40fcd41 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -415,7 +415,7 @@
{
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",