bmcweb: Memory: Why not use "Present" for Redfish's Status State ?
Hi Ed and Pawel,
I am missing some context here.
Why if MemorySizeInKB is 0 we set the "Status""State" of the DIMM to Absent? Why not use the Present property?
https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/memory.hpp#L373
By default MemorySizeInKB is 0 so if MemorySizeInKB hasn't been set your DIMM looks like (all other properties are skipped):
curl -k https://$bmc/redfish/v1/Systems/system/Memory/dimm6
{
"@odata.id": "/redfish/v1/Systems/system/Memory/dimm6", "@odata.type": "#Memory.v1_7_0.Memory",
"Id": "dimm6",
"Name": "DIMM Slot",
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Absent"}
This logic was added here:
https://github.com/openbmc/bmcweb/commit/443c2934ac1ae86b6d496e3509e2b8acf283fb18
Thanks,
Gunnar
+1
In some cases we can only detect presence of DIMMs, but not the details. In such cases this logic a bit painful.
Quoted 32 lines · Gunnar Mills
Hi Ed and Pawel,
I am missing some context here.
Why if MemorySizeInKB is 0 we set the "Status""State" of the DIMM to Absent?
Why not use the Present property?https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/memory.hpp#L373
By default MemorySizeInKB is 0 so if MemorySizeInKB hasn't been set your
DIMM looks like (all other properties are skipped):curl -k https://$bmc/redfish/v1/Systems/system/Memory/dimm6
{ "@odata.id": "/redfish/v1/Systems/system/Memory/dimm6", "@odata.type": "#Memory.v1_7_0.Memory", "Id": "dimm6", "Name": "DIMM Slot", "Status": { "Health": "OK", "HealthRollup": "OK", "State": "Absent" }This logic was added here:
https://github.com/openbmc/bmcweb/commit/443c2934ac1ae86b6d496e3509e2b8acf283fb18Thanks,
Gunnar
Signature · 2 lines
Best regards, Andrei Kartashev