Fix clearing of CPU error and crashdump counts
The error and crashdump counts are uint8_t values, so a literal
0 must be cast as a uint8_t or it will be rejected on DBus.
Also need to clear all 4 CPU counts stored in settings.
Tested:
Started with a non-zero CPU Error and Crashdump count and cleared
each one:
5 CPU Errors and 14 Crashdumps:
ipmitool raw 0x30 0x9a
00 3f 45 c0 c0 c0 0e
Clear the CPU Errors:
ipmitool raw 0x30 0x9b 0 0 1
0 CPU Errors and 14 Crashdumps:
ipmitool raw 0x30 0x9a
00 3f 40 c0 c0 c0 0e
Clear the Crashdumps:
ipmitool raw 0x30 0x9b 0 0 2
0 CPU Errors and 0 Crashdumps:
ipmitool raw 0x30 0x9a
00 3f 40 c0 c0 c0 00
Change-Id: I19948b7e1d862749b98901b8e17e840cf78fc0b7
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 2d3c5c6..a11d3b5 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -592,14 +592,23 @@
if (clearCPUErrorCount.value_or(false))
{
ipmi::setDbusProperty(*busp, service, processorErrConfigObjPath,
- processorErrConfigIntf, "ErrorCountCPU1", 0);
+ processorErrConfigIntf, "ErrorCountCPU1",
+ static_cast<uint8_t>(0));
ipmi::setDbusProperty(*busp, service, processorErrConfigObjPath,
- processorErrConfigIntf, "ErrorCountCPU2", 0);
+ processorErrConfigIntf, "ErrorCountCPU2",
+ static_cast<uint8_t>(0));
+ ipmi::setDbusProperty(*busp, service, processorErrConfigObjPath,
+ processorErrConfigIntf, "ErrorCountCPU3",
+ static_cast<uint8_t>(0));
+ ipmi::setDbusProperty(*busp, service, processorErrConfigObjPath,
+ processorErrConfigIntf, "ErrorCountCPU4",
+ static_cast<uint8_t>(0));
}
if (clearCrashdumpCount.value_or(false))
{
ipmi::setDbusProperty(*busp, service, processorErrConfigObjPath,
- processorErrConfigIntf, "CrashdumpCount", 0);
+ processorErrConfigIntf, "CrashdumpCount",
+ static_cast<uint8_t>(0));
}
}
catch (std::exception& e)