summaryrefslogtreecommitdiffstats
path: root/chassis_state_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clang 6 updatesAndrew Geissler2018-08-311-1/+1
| | | | | | | Just some minor spelling fixes on the namespaces Change-Id: I9ed639a4d78b7fbc6f796ed8f74eee9316c429e0 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Add LastStateChangeTime to chassis managerMatt Spinler2018-08-061-0/+92
| | | | | | | | | | | | | | This property is set to the timestamp of the last time the chassis power state changed. It is persisted so it survives reboots. Resolves openbmc/openbmc#3300 Tested: Various incantations of power cycling, reboots, and AC pulls. Change-Id: I19f244e0490bc9b921454e393989a9cbd283e2dd Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Minor power on hours serialization changesMatt Spinler2018-08-061-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for the chassis manager class persisting another data member, some changes need to be made to the POH serialization code to make it consistent with saving individual data members in separate files. 1) Remove the load()/save() functions from the Chassis class. Cereal only requires those when archiving a custom object, like when the Host class uses oarchive(*this). 2) Remove the Cereal version define from the Chassis class. That is also only used when a custom object is serialized, and in fact the version wasn't being stored in the serialized data anyway. 3) Rename the POH serialization/deserialization functions to be specifically for the POH counter. These don't affect how or where POH value is persisted. Tested: Verify the POH value still increments and survives reboots. Change-Id: I065e1a24e018b66f284c6a00f9a34d24eaaedc36 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* chassis-state-manager: Check for dbus call errorsWilliam A. Kennington III2018-06-281-21/+40
| | | | | | | | | | | | | | | | | Making the query to the power state manager can fail if that daemon does not come up before the chassis state manager. Since we added exceptions to sdbusplus for call errors, we get an unhandled exception if this daemon is not running. Since the pgood daemon will announce the power status when it starts up, we can just assume the power is off if the call fails. Eventually it will become correct. This restores the same behavior we had in the past. Tested: Ran on a zaius machine and it no longer fails / prints errors in the common cases and eventually gets to the proper state. Change-Id: I78809d747219f1096e0ea36905199a35e3b93caa Signed-off-by: William A. Kennington III <wak@google.com>
* chassis-state-manager: Clean up sdbusplus exception handlingWilliam A. Kennington III2018-05-301-11/+49
| | | | | | | | | | | | | | In order to support error handling for message operations, we need to make sure we are catching exceptions thrown by sdbusplus. Tested: Built / ran on a fully tray pulled zaius. Correctly detected the host was off and did the automatic transition to boot the machine at BMC start. Chassis power commands still work as expected and show up as state transitions. Change-Id: I3468209b215df6535bb5357a62335da151d81897 Signed-off-by: William A. Kennington III <wak@google.com>
* Add Chassis POH CounterNagaraju Goruganti2018-05-121-1/+127
| | | | | | | | | | | | | Added 32-bit counter, which shows how many hours the system has been running. The value is a cumulative one and includes all working hours since production. If the chassis state is Powered-on, This will be incremented by one for every hour. It won't get updated when the chassis state is powered-off. Resolves openbmc/openbmc#2979 Change-Id: I18e9bb571d1a6e401b25450168249f70891be665 Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Apply clang code format to this state repoAndrew Geissler2018-01-251-49/+39
| | | | | Change-Id: I232af39d8ded90fa3eb37b74d1435ddbf19fffb1 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Use the new hard power off target for chassis off requestsAndrew Geissler2017-07-211-1/+3
| | | | | | | | | | This will ensure the system is immedidately powered off when a chassis off request is issued Resolves openbmc/openbmc#1933 Change-Id: I7a6ab93e3b8e1f2b4e590cafc926775b989f107b Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* chassis: use latest sdbusplus match APIsPatrick Williams2017-05-111-10/+2
| | | | | Change-Id: I1be75ab5af362d683be76afb47d8c411f0f4a4b2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* {chassis,host}_state_manager: Fix 'Recieved' typoAndrew Jeffery2017-04-191-2/+2
| | | | | Change-Id: I90ef5d88595a226dd7115d6c224928cf30b5c7d8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* Remove Chassis power on messages when powering offJosh D. King2017-04-171-2/+62
| | | | | | | | | | | Currently Chassis state services show incorrect states when a target exits. To fix this, a bus call is used on the target to determine its ActiveState. Doing that helps to determine if the target is already powered on and is now powering down. Change-Id: I55bc87fa9ff647212fe545b7edd7df8a85e9e223 Signed-off-by: Josh D. King <jdking@us.ibm.com>
* Refactor action target names Power-on-offJosh D. King2017-04-111-2/+2
| | | | | | | | | The target change is: obmc-power-chassis-on -> obmc-chassis-poweron obmc-power-chassis-off -> obmc-chassis-poweroff Change-Id: I31af899b1b32de6f7c747264be19f14b43c4c4ee Signed-off-by: Josh D. King <jdking@us.ibm.com>
* Import phosphor-logging header files from new directorySaqib Khan2017-02-201-1/+1
| | | | | | | | | Phase2: Changing the phosphor-logging header files import from base dir to files under phosphor-logging folder. Once all projects import from the new dir, the files in the base dir will be deleted. Change-Id: I7152da5f0737171b9919bd082b09aa8ce4761430 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Use systemd target states to track chassis on/off statesAndrew Geissler2017-02-011-23/+47
| | | | | Change-Id: Id76074cc500fa8d147d3d219af62f8d224881b18 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Call new chassis power targets during on/off requestsAndrew Geissler2017-02-011-0/+29
| | | | | | | | | New targets were introduced recently to support just the power on and off of the chassis (no boot of host). This code change makes use of these new targets. Change-Id: Ibf942a9ed27ccc982a36cd755afdf6171cb5c0a6 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Use pgood signal to keep internal state updatedAndrew Geissler2017-01-131-0/+25
| | | | | Change-Id: I35a2e67afc877488ceb1a0e0255b99b9db792201 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Determine chassis power state on application startupAndrew Geissler2017-01-131-0/+35
| | | | | Change-Id: I406b2a6c7af1e4c26af0e43a432a130c967d84bc Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Initial chassis state management codeAndrew Geissler2017-01-131-0/+35
This is just the basics to get the generated code compiling and to verify the basic dbus interfaces. Change-Id: I335964da456d8173e2ce792c6614770da43303b4 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
OpenPOWER on IntegriCloud