Change linkage of ipmid_get_sdbus_plus_handler() to libipmid.so
ipmid_get_sdbus_plus_handler() was re-added to be a part of
systemintfcmds where it was used. This moves it to libipmid.so
because that is where symbols used by both ipmid and the providers
should be.
Because ipmid_get_sdbus_plus_handler() relies on the io service and the
main sdbus::asio::connection is also right there, this moves those
symbols to libipmid as well to keep coherent.
Change-Id: Ib125a0c217c8bcf47a8a4bd0c557eb69e928245b
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index 00e6c51..aeded06 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -146,17 +146,8 @@
__attribute__((init_priority(101)));
std::unique_ptr<sdbusplus::server::manager::manager> objManager
__attribute__((init_priority(101)));
-std::unique_ptr<sdbusplus::asio::connection> sdbusp
- __attribute__((init_priority(101)));
} // namespace
-// this is used by openpower-host-ipmi-oem
-std::unique_ptr<sdbusplus::asio::connection>& ipmid_get_sdbus_plus_handler()
-{
- return sdbusp;
-}
-
-#include <unistd.h>
void register_netfn_app_functions()
{
@@ -179,15 +170,8 @@
// Create new xyz.openbmc_project.host object on the bus
auto objPath = std::string{CONTROL_HOST_OBJ_MGR} + '/' + HOST_NAME + '0';
- // Create a new sdbus connection so it can have a well-known name
- sd_bus* bus = nullptr;
- sd_bus_open_system(&bus);
- if (!bus)
- {
- return;
- }
- auto io = getIoService();
- sdbusp = std::make_unique<sdbusplus::asio::connection>(*io, bus);
+ std::unique_ptr<sdbusplus::asio::connection>& sdbusp =
+ ipmid_get_sdbus_plus_handler();
// Add sdbusplus ObjectManager.
objManager = std::make_unique<sdbusplus::server::manager::manager>(