summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Walter <christian.walter@9elements.com>2026-03-02 14:13:25 +0300
committerChristian Walter <christian.walter@9elements.com>2026-03-02 15:50:44 +0300
commit82a92ac8e45e82cb654a89bc987c767a614ea909 (patch)
treeb07834ce7b89d3ed22ccb87a1953ee9a91732be8
parent9973de7bb1f92a6c6815c9b5d3f69a16e722b1ff (diff)
downloadbmcweb-82a92ac8e45e82cb654a89bc987c767a614ea909.tar.xz
processor: Use lowercase hex prefix for ProcessorId fields
The Redfish schema for Processor requires IdentificationRegisters and related ProcessorId fields to match the pattern ^0x[0-9A-Fa-f]+$. The std::format specifier {:#X} produces an uppercase "0X" prefix (e.g. "0XBFEBFBFF000806F8"), which fails schema validation. Change to {:#x} to produce the lowercase "0x" prefix that the schema requires (e.g. "0xbfebfbff000806f8"). This affects EffectiveFamily, EffectiveModel, IdentificationRegisters, MicrocodeInfo, and Step. Tested: Ran DMTF Redfish Service Validator; ProcessorId fields now pass the pattern check. Change-Id: Id70abd2904e5b9d12b7d213d5da79802021535fe Signed-off-by: Christian Walter <christian.walter@9elements.com>
-rw-r--r--redfish-core/lib/processor.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp
index 5b4ec99150..6b7db66263 100644
--- a/redfish-core/lib/processor.hpp
+++ b/redfish-core/lib/processor.hpp
@@ -167,7 +167,7 @@ inline void getCpuDataByInterface(
{
asyncResp->res.jsonValue["ProcessorId"]["EffectiveFamily"] =
- std::format("{:#04X}", *value);
+ std::format("{:#04x}", *value);
}
}
else if (property.first == "EffectiveModel")
@@ -181,7 +181,7 @@ inline void getCpuDataByInterface(
if (*value != 0)
{
asyncResp->res.jsonValue["ProcessorId"]["EffectiveModel"] =
- std::format("{:#04X}", *value);
+ std::format("{:#04x}", *value);
}
}
else if (property.first == "Id")
@@ -191,7 +191,7 @@ inline void getCpuDataByInterface(
{
asyncResp->res
.jsonValue["ProcessorId"]["IdentificationRegisters"] =
- std::format("{:#016X}", *value);
+ std::format("{:#016x}", *value);
}
}
else if (property.first == "Microcode")
@@ -205,7 +205,7 @@ inline void getCpuDataByInterface(
if (*value != 0)
{
asyncResp->res.jsonValue["ProcessorId"]["MicrocodeInfo"] =
- std::format("{:#08X}", *value);
+ std::format("{:#08x}", *value);
}
}
else if (property.first == "Step")
@@ -219,7 +219,7 @@ inline void getCpuDataByInterface(
if (*value != std::numeric_limits<uint16_t>::max())
{
asyncResp->res.jsonValue["ProcessorId"]["Step"] =
- std::format("{:#04X}", *value);
+ std::format("{:#04x}", *value);
}
}
}