From 369406e6c157a6656a08331cc5fb85313ba7154e Mon Sep 17 00:00:00 2001 From: Richard Marian Thomaiyar Date: Thu, 9 Jan 2020 14:56:54 +0530 Subject: [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 --- ipmid-new.cpp | 16 ++++++++-------- 1 file 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(*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 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 -- cgit v1.2.1