diff options
-rw-r--r-- | occ_finder.cpp | 3 | ||||
-rw-r--r-- | occ_finder.hpp | 5 | ||||
-rw-r--r-- | occ_manager.hpp | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/occ_finder.cpp b/occ_finder.cpp index a533067..b47cc8f 100644 --- a/occ_finder.cpp +++ b/occ_finder.cpp @@ -23,7 +23,7 @@ constexpr auto toChar(size_t c) return map[c]; } -std::vector<std::string> get() +std::vector<std::string> get(sdbusplus::bus::bus& bus) { namespace fs = std::experimental::filesystem; using Path = std::string; @@ -31,7 +31,6 @@ std::vector<std::string> get() using Interface = std::string; using Interfaces = std::vector<Interface>; - auto bus = sdbusplus::bus::new_default(); auto mapper = bus.new_method_call( "xyz.openbmc_project.ObjectMapper", diff --git a/occ_finder.hpp b/occ_finder.hpp index cad8277..c096c4b 100644 --- a/occ_finder.hpp +++ b/occ_finder.hpp @@ -2,6 +2,7 @@ #include <vector> #include <string> +#include <sdbusplus/bus.hpp> namespace open_power { @@ -12,8 +13,10 @@ namespace finder /** @brief Get OCC objects on the system by mapping them to CPU inventory * @returns vector of occ objects, such as occ0, occ1, and so on. + * + * @param[in] bus - sdbusplus handler */ -std::vector<std::string> get(); +std::vector<std::string> get(sdbusplus::bus::bus& bus); } // namespace finder } // namespace occ diff --git a/occ_manager.hpp b/occ_manager.hpp index df6f199..e79ac3c 100644 --- a/occ_manager.hpp +++ b/occ_manager.hpp @@ -44,7 +44,7 @@ struct Manager event(event) { // Check if CPU inventory exists already. - auto occs = open_power::occ::finder::get(); + auto occs = open_power::occ::finder::get(bus); if (occs.empty()) { // Need to watch for CPU inventory creation. |