Lines Matching +full:host +full:- +full:command

3 #include "host-cmd-manager.hpp"
8 #include <phosphor-logging/elog-errors.hpp>
9 #include <phosphor-logging/lg2.hpp>
13 #include <xyz/openbmc_project/State/Host/server.hpp>
17 using HostState = sdbusplus::common::xyz::openbmc_project::state::Host;
21 namespace host namespace
23 namespace command namespace
44 // Called as part of READ_MSG_DATA command
51 lg2::error("Failure to STOP the timer: {ERROR}", "ERROR", strerror(-r)); in getNextCommand()
54 if (this->workQueue.empty()) in getNextCommand()
57 // asserted for the host (probably from a previous boot). in getNextCommand()
58 lg2::debug("Control Host work queue is empty!"); in getNextCommand()
64 auto command = this->workQueue.front(); in getNextCommand() local
65 this->workQueue.pop(); in getNextCommand()
67 // IPMI command is the first element in pair in getNextCommand()
68 auto ipmiCmdData = std::get<0>(command); in getNextCommand()
73 std::get<CallBack>(command)(ipmiCmdData, true); in getNextCommand() local
76 this->checkQueueAndAlertHost(); in getNextCommand()
78 // Tuple of command and data in getNextCommand()
85 lg2::error("Host control timeout hit!"); in hostTimeout()
93 while (!this->workQueue.empty()) in clearQueue()
95 auto command = this->workQueue.front(); in clearQueue() local
96 this->workQueue.pop(); in clearQueue()
98 // IPMI command is the first element in pair in clearQueue()
99 auto ipmiCmdData = std::get<0>(command); in clearQueue()
101 // Call the implementation specific Command Failure. in clearQueue()
103 std::get<CallBack>(command)(ipmiCmdData, false); in clearQueue() local
107 // Called for alerting the host
110 if (this->workQueue.size() >= 1) in checkQueueAndAlertHost()
125 lg2::error("Error starting timer for control host"); in checkQueueAndAlertHost()
130 this->bus.new_method_call(HOST_IPMI_SVC.c_str(), IPMI_PATH.c_str(), in checkQueueAndAlertHost()
135 auto reply = this->bus.call(method); in checkQueueAndAlertHost()
147 void Manager::execute(CommandHandler command) in execute() argument
149 lg2::debug("Pushing cmd on to queue, command: {COMMAND}", "COMMAND", in execute()
150 std::get<0>(command).first); in execute()
152 this->workQueue.emplace(command); in execute()
154 // Alert host if this is only command in queue otherwise host will in execute()
156 if (this->workQueue.size() == 1) in execute()
158 this->checkQueueAndAlertHost(); in execute()
162 lg2::info("Command in process, no attention"); in execute()
186 if (server::Host::convertTransitionFromString(requestedState) == in clearQueueOnPowerOn()
187 server::Host::Transition::On) in clearQueueOnPowerOn()
193 } // namespace command
194 } // namespace host