summaryrefslogtreecommitdiffstats
path: root/host_state_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable Cereal class versioningVishwanatha Subbanna2017-10-061-0/+2
| | | | | | | | | | | | Cereal class versioning helps to handle data de-serialization across different class versions that differ in the way, a particular data is serialized. For more reading, refer Cereal official documentation; http://uscilab.github.io/cereal/serialization_functions.html Change-Id: Ic5d01090b7a7679ef2bf638da786abbd033007bc Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add persistancy for boot progress and os statusDhruvaraj Subhashchandran2017-09-271-0/+14
| | | | | | | Resolves openbmc/openbmc#2181 Change-Id: I807dd94efcea1118060f8594c7f69e333a3ea682 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Fix for deserialize cereal exceptionJayanth Othayoth2017-09-201-6/+15
| | | | | | | | | This commit provides a fix for an issue in which the cereal deserialize() would crash the phosphor-host-state-manager, incase persistence file is empty in restore path. Change-Id: I5f7774166b5a719fa035b2a2cd4f041303a1e6bf Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
* Move all restore state policy into discover_stateAndrew Geissler2017-09-051-40/+28
| | | | | | | | | | | | | | | | Doing this so the host state code can set it's requested host transition state without calling the override function. Need to initialize it to the persisted cereal value but not act on it. The phosphor_discover_state application will ensure the appropriate action is taken based on the system state and the persisted value of the last requested host state. Resolves openbmc/openbmc#2210 Change-Id: I7bef12fe314c7dfe137494fd46ddb35309063fc5 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Reset BootProgress and OS Status after power offDhruvaraj Subhashchandran2017-08-221-1/+5
| | | | | | | Resolves openbmc/openbmc#2131 Change-Id: I0559d378088971e3ba03bbb84111f297dd8b3514 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Decrement reboot counter on all boot attemptsAndrew Geissler2017-08-161-5/+25
| | | | | | | | | | | | | | OpenBMC will control the default amount of boot attemps allowed on systems. If an external entity requests to set the boot count, it will be treated as a command to reset the boot count to the OpenBMC configured default. Resolves openbmc/openbmc#1676 Resolves openbmc/openbmc#1646 Change-Id: I7d03272d174685a72e1bdff4d7e2142fc69b7edf Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Use new host reboot target to reboot hostAndrew Geissler2017-08-121-26/+4
| | | | | | | Resolves openbmc/openbmc#2032 Change-Id: Iaee1fcae2a758324266cd8afdc2a738f7838aca4 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Implementation of OS status, boot count and boot progressDhruvaraj Subhashchandran2017-08-011-36/+5
| | | | | Change-Id: I1b00a932db2533b83fa0bd7bb4fbd62c0299bff7 Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* host: power_restore: switch to new settings APIDeepak Kodihalli2017-07-271-50/+21
| | | | | Change-Id: Ie44e421ad690527d1883f03dcde9d499282ecacc Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* host: auto_reboot: switch to new settings APIDeepak Kodihalli2017-07-271-49/+15
| | | | | Change-Id: Ic65a6dab922ef08e68205d4e16bb849baff353c4 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Persist user requested host stateDhruvaraj Subhashchandran2017-07-271-8/+85
| | | | | | | Resolves openbmc/openbmc#1785 Change-Id: I5f23ce50dc357489c7b7eece8bab3bfd6a61ffae Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
* Enable soft power offAndrew Geissler2017-06-061-1/+5
| | | | | | | | | | | | The shutdown target provides the soft power off function and also handles situations where the service should be skipped Resolves openbmc/openbmc#1286 Resolves openbmc/openbmc#1670 Change-Id: I2c1705f09f7840107ae0cc15ede02eafd50fcbbd Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Increase boot count for SBE side switchAndrew Geissler2017-06-021-1/+2
| | | | | | | | The host gets one additional boot try when switching over to the alternate SBE seeprom side Change-Id: Ifbf3bfaf649bc15737aa2e03414c0d5fee216b2e Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Revert "Use shutdown target to stop the host"Andrew Geissler2017-05-241-5/+1
| | | | | | | | | | | | | This reverts commit c99ad19b76f233f2c31a02d133770377572fc92a. Unfortunately this was not ready for prime time yet. The host ipmid server calls the host state code to power down, which ends up calling the host-ipmid code for a power down. Resolves openbmc/openbmc#1657 Change-Id: I699dba427c5104c7278d04a61224441edf3df216 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Use shutdown target to stop the hostAndrew Geissler2017-05-231-1/+5
| | | | | | | | | | | The shutdown target will use the soft power off application which allows the host to properly shut itself down before power is removed from the chassis Resolves openbmc/openbmc#1286 Change-Id: I7be630237571847a9fa6c37b0b9a8fddf568e47b Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Remove use of system managerJosh D. King2017-05-191-17/+1
| | | | | | | | | Host state manager used to use system manager in order to check whether it is running or not. Now we are directly checking the target. Change-Id: Idb3a72685b58770833c2c9056b9c75ac67703dc5 Signed-off-by: Josh D. King <jdking@us.ibm.com>
* Check Quiesce State before issuing auto rebootJosh D. King2017-05-181-1/+2
| | | | | | | | | | | Quiesce state was going into a reboot when we issued a power off command. Added logic to check the state before autoReboot occurs. Resolves openbmc/openbmc#1475 Change-Id: I5cd9375a1c68b89e0b777ff436f90e553f2e6b32 Signed-off-by: Josh D. King <jdking@us.ibm.com>
* host: use latest sdbusplus match APIsPatrick Williams2017-05-111-12/+2
| | | | | Change-Id: Iec0ae14c49c07568110bdebeaa0505db40d92540 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add journal entry for BOOTCOUNTSaqib Khan2017-05-051-17/+33
| | | | | | | | | | Update the jounal entry in the host state code to indicate we may have hit the HOST BOOTCOUNT. Resolves openbmc/openbmc#1424 Change-Id: I2bfd73f6051efb408eb4c683cebe95fda4700859 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Look for new quiesce targetJosh D. King2017-04-201-1/+1
| | | | | | | | Changed target name from: obmc-quiesce-host -> obmc-host-quiesce Change-Id: I72fbc52d1ab5503fe633dc65b9228263546daeda Signed-off-by: Josh D. King <jdking@us.ibm.com>
* {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 Hosts power on messages when powering offJosh D. King2017-04-171-3/+64
| | | | | | | | | | | Currently Host 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: Id91dc8156308372fc1649526a7b6dedee94eeb01 Signed-off-by: Josh D. King <jdking@us.ibm.com>
* Refactor action target names Host-start-stopJosh D. King2017-04-131-2/+2
| | | | | | | | | The target change is: obmc-chassis-stop -> obmc-host-stop obmc-chassis-start -> obmc-host-start Change-Id: I70fc0af68c9b493231aa9e4e698d33ae9d57cfc4 Signed-off-by: Josh D. King <jdking@us.ibm.com>
* Move object_mapper per dbus path conventions.Leonel Gonzalez2017-03-201-1/+1
| | | | | | | Partial fix for openbmc/openbmc#1112. Change-Id: Ib8a1e10867aed4af5376076a7f12f4e38ef9c79f Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
* Use the Host BOOTCOUNT to keep track of rebootsSaqib Khan2017-03-201-1/+38
| | | | | | | | | | | | | We will use the existing HOST BOOTCOUNT to determine if the Host should perform a reboot before going to the quiesce state. When the counter reaches 0, the BOOTCOUNT will be reset to 2 and the HOST will enter the quiesce state. Resolves openbmc/openbmc#1181 Change-Id: Ib67792476993899c6c21f3917f4b760040f23a2e Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add quiesce to the HOST stateSaqib Khan2017-02-241-1/+3
| | | | | | | | If the autoreboot is set to false, then the system state query will reflect quiesce state. Change-Id: I2c98646b9b97733e0cf0bd2db77f542074618a9a Signed-off-by: Saqib Khan <khansa@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>
* State manager auto-reboot logic for quiesce stateMichael Tritz2017-02-201-0/+84
| | | | | | | | | | These changes will add logic to state manager so that, when the system reaches quiesce state, it will either reboot or not, per the user preference. Change-Id: I72952cd9528620fabeb499109e3790298fdd976b Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
* Send initial transition value to base classAndrew Geissler2017-02-011-4/+4
| | | | | | | | Fix to not redundantly call the systemd target when initially discovering chassis state Change-Id: I5673ab59581c9ddfb00df52af05184602654836d Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Use systemd targets to track host statesAndrew Geissler2017-02-011-23/+45
| | | | | Change-Id: I5ab174d945c1dfb265a02f9095d3eaeb0ba562db Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Move tracing over to phosphor-logging interfacesAndrew Geissler2017-01-121-15/+18
| | | | | Change-Id: I1af70670f4e6e941c2656cfc2877789903e9aec0 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Default requestedHostTransition to value on startupAndrew Geissler2017-01-091-0/+2
| | | | | | | | | | The persistence and enforcement of the requested state will come in a different chain of commits. For now, we just want this to match up with what we read from the system target for our current state. Change-Id: Iaeb60e074c3bfc6046bf00b72f512cab1012342c Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Support reboot transition request in host interfaceAndrew Geissler2017-01-091-3/+36
| | | | | Change-Id: Ic09ccf710f13697fd203ca1b96c3b5084a76511b Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Process system state changesAndrew Geissler2017-01-091-8/+37
| | | | | | | | | | | Use the system state signal to know when to change the state of the host The signal we look at may change with future skeleton refactors but this is the best signal for now Change-Id: Ibba7cc5628994425520c21cdf122d2710f8164aa Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Host state power on and off supportAndrew Geissler2017-01-091-7/+44
| | | | | | | | | This supports the basic systemd transitions to power on and off a host. Future commits will handle monitoring for the state transition to finish and updating the current state. Change-Id: I1ada1f4e7bd2844db49e63aaaf5b64c88b4af127 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Optimize namespace usage in phosphor-state-managerAndrew Geissler2017-01-061-12/+9
| | | | | | | | | The lengthy namespace string into the base class is getting annoying. I think this is a good compromise to reduce the string but keep it clear where the code is going. Change-Id: I21a258d586eff4db30544c810467d569a92434e5 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Determine host state on application startupAndrew Geissler2017-01-061-0/+55
| | | | | | | | This code brings some coherence to the internal host state and transition values within the host state manager Change-Id: I989a40bb01d5c1c16c7e42cceac1bc99ce3222f4 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Initial phosphor-state-manager commitAndrew Geissler2017-01-061-0/+13
Still a lot of work to come with this one but this is the initial makefile and building of a basic application that provides dbus introspection and properties of the xyz/openbmc_project/State/Host.interface.yaml Change-Id: I406fafa6a50721b2f28ab6df03ef98a940e2db6e Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
OpenPOWER on IntegriCloud