summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>2020-01-09 14:56:54 +0530
committerVernon Mauery <vernon.mauery@linux.intel.com>2020-01-21 16:55:04 +0000
commit369406e6c157a6656a08331cc5fb85313ba7154e (patch)
treef3c0572a16e5bf6d3311907f9a9404895d36dedd
parent43263c60af68202794a1b08892f9d42aba1b41a6 (diff)
downloadphosphor-host-ipmid-369406e6c157a6656a08331cc5fb85313ba7154e.tar.gz
phosphor-host-ipmid-369406e6c157a6656a08331cc5fb85313ba7154e.zip
[ipmid]: Advertise D-Bus signals, only when ready
Requesting the bus name & sending out InterfacesAdded signal earlier causes phosphor-mapper introspect to fail, as ipmi command handler registration & initialization was in progress before hitting io->run(). Hence moved the code to advertise about D-Bus signal, once ipmid is done with init & registration. This fixes phosphor-mapper timeout. Tested: 1. Verified that phosphor-mapper timeout doesn't happen, even when there is delay in cmd handler registrations etc. Change-Id: I3bb565c0e39f2604dde30e21b9539ce88b73cb0e Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
-rw-r--r--ipmid-new.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipmid-new.cpp b/ipmid-new.cpp
index 3612884..bb427f7 100644
--- a/ipmid-new.cpp
+++ b/ipmid-new.cpp
@@ -820,7 +820,6 @@ int main(int argc, char* argv[])
}
auto sdbusp = std::make_shared<sdbusplus::asio::connection>(*io, bus);
setSdBus(sdbusp);
- sdbusp->request_name("xyz.openbmc_project.Ipmi.Host");
// TODO: Hack to keep the sdEvents running.... Not sure why the sd_event
// queue stops running if we don't have a timer that keeps re-arming
@@ -837,13 +836,6 @@ int main(int argc, char* argv[])
std::forward_list<ipmi::IpmiProvider> providers =
ipmi::loadProviders(HOST_IPMI_LIB_PATH);
- // Add bindings for inbound IPMI requests
- auto server = sdbusplus::asio::object_server(sdbusp);
- auto iface = server.add_interface("/xyz/openbmc_project/Ipmi",
- "xyz.openbmc_project.Ipmi.Server");
- iface->register_method("execute", ipmi::executionEntry);
- iface->initialize();
-
#ifdef ALLOW_DEPRECATED_API
// listen on deprecated signal interface for kcs/bt commands
constexpr const char* FILTER = "type='signal',interface='org.openbmc."
@@ -874,6 +866,14 @@ int main(int argc, char* argv[])
registerSignalHandler(ipmi::prioOpenBmcBase, SIGINT, stopAsioRunLoop);
registerSignalHandler(ipmi::prioOpenBmcBase, SIGTERM, stopAsioRunLoop);
+ sdbusp->request_name("xyz.openbmc_project.Ipmi.Host");
+ // Add bindings for inbound IPMI requests
+ auto server = sdbusplus::asio::object_server(sdbusp);
+ auto iface = server.add_interface("/xyz/openbmc_project/Ipmi",
+ "xyz.openbmc_project.Ipmi.Server");
+ iface->register_method("execute", ipmi::executionEntry);
+ iface->initialize();
+
io->run();
// destroy all the IPMI handlers so the providers can unload safely
OpenPOWER on IntegriCloud