chassishanlder: restorePolicy supports Unknown type
The PDI interface of RestorePolicy already supports None type [1],
and ipmitool will resolve it to 0x03 by default. This commit is
adding None type.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Control/Power/RestorePolicy.interface.yaml#L24
Tested: If the value of the PowerRestorePolicy attribute on DBus is
equal to xyz.openbmc_project.Control.Power.RestorePolicy.Policy.None
1. without this patch:
~# ipmitool chassis status
Error sending Chassis Status command: Unspecified error
2. with this patch:
~# ipmitool chassis status
System Power : off
Power Overload : false
Power Interlock : inactive
Main Power Fault : false
Power Control Fault : false
Power Restore Policy : unknown
Last Power Event :
Chassis Intrusion : inactive
Front-Panel Lockout : inactive
Drive Fault : false
Cooling/Fan Fault : false
Front Panel Control : none
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I91ae1c40229c8646846443c0977685241f456838
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 414d6cb..c7c1fed 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -930,7 +930,8 @@
const std::map<DbusValue, IpmiValue> dbusToIpmi = {
{RestorePolicy::Policy::AlwaysOff, 0x00},
{RestorePolicy::Policy::Restore, 0x01},
- {RestorePolicy::Policy::AlwaysOn, 0x02}};
+ {RestorePolicy::Policy::AlwaysOn, 0x02},
+ {RestorePolicy::Policy::None, 0x03}};
static constexpr uint8_t noChange = 0x03;
static constexpr uint8_t allSupport = 0x01 | 0x02 | 0x04;