Andrew Geissler | fe270d3 | 2021-01-27 14:06:46 -0600 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "config.h" |
| 4 | |
| 5 | #include "settings.hpp" |
| 6 | #include "xyz/openbmc_project/State/Host/server.hpp" |
| 7 | |
| 8 | #include <sdbusplus/bus.hpp> |
| 9 | |
| 10 | namespace phosphor |
| 11 | { |
| 12 | namespace state |
| 13 | { |
| 14 | namespace manager |
| 15 | { |
| 16 | |
| 17 | using HypervisorInherit = sdbusplus::server::object::object< |
| 18 | sdbusplus::xyz::openbmc_project::State::server::Host>; |
| 19 | |
| 20 | namespace server = sdbusplus::xyz::openbmc_project::State::server; |
| 21 | |
| 22 | /** @class Host |
| 23 | * @brief OpenBMC host state management implementation. |
| 24 | * @details A concrete implementation for xyz.openbmc_project.State.Host |
| 25 | * DBus API. |
| 26 | */ |
| 27 | class Hypervisor : public HypervisorInherit |
| 28 | { |
| 29 | public: |
| 30 | Hypervisor() = delete; |
| 31 | Hypervisor(const Hypervisor&) = delete; |
| 32 | Hypervisor& operator=(const Hypervisor&) = delete; |
| 33 | Hypervisor(Hypervisor&&) = delete; |
| 34 | Hypervisor& operator=(Hypervisor&&) = delete; |
| 35 | virtual ~Hypervisor() = default; |
| 36 | |
| 37 | /** @brief Constructs Hypervisor State Manager |
| 38 | * |
| 39 | * @param[in] bus - The Dbus bus object |
| 40 | * @param[in] objPath - The Dbus object path |
| 41 | */ |
| 42 | Hypervisor(sdbusplus::bus::bus& bus, const char* objPath) : |
| 43 | HypervisorInherit(bus, objPath, false), bus(bus) |
| 44 | {} |
| 45 | |
| 46 | /** @brief Set value of HostTransition */ |
| 47 | server::Host::Transition |
| 48 | requestedHostTransition(server::Host::Transition value) override; |
| 49 | |
| 50 | /** @brief Set value of CurrentHostState */ |
| 51 | server::Host::HostState |
| 52 | currentHostState(server::Host::HostState value) override; |
| 53 | |
| 54 | private: |
| 55 | /** @brief Persistent sdbusplus DBus bus connection. */ |
| 56 | sdbusplus::bus::bus& bus; |
| 57 | }; |
| 58 | |
| 59 | } // namespace manager |
| 60 | } // namespace state |
| 61 | } // namespace phosphor |