summaryrefslogtreecommitdiffstats
path: root/occ_manager.cpp
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-12-04 00:54:01 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-12-04 20:08:35 +0000
commit30417a15fa35e26d5127f12e0a85c3fe74eff0d0 (patch)
tree573fbf4425c1a5b0e988d08e3b365060946dc8a2 /occ_manager.cpp
parent636577f44fe3fc951538c1119ed0da8ac9a40932 (diff)
downloadopenpower-occ-control-30417a15fa35e26d5127f12e0a85c3fe74eff0d0.tar.gz
openpower-occ-control-30417a15fa35e26d5127f12e0a85c3fe74eff0d0.zip
Create OCC objects on app startup
Previously OCC objects would be created either in response (D-Bus signals) to CPU inventory objects being created, or if the CPU objects were already present when the openpower-occ-control app starts. We've had few issues where it has seemed like the OCC objects never got created, or did not get created in time; the CPU objects were created though. This is suggestive of either a race, or the D-Bus signal being missed altogether. Simplify by creating OCC objects when the app starts (we know how many OCC objects to create based on system specific config), instead of doing it reactively. The OCC objects will be marked active only when we're sent a sensor from the host asking to do so. That's not changing. Change-Id: I782ea4f120292542e3c7b32b1e0acfa8efb5e8e6 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Diffstat (limited to 'occ_manager.cpp')
-rw-r--r--occ_manager.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/occ_manager.cpp b/occ_manager.cpp
index 7d51490..42b6390 100644
--- a/occ_manager.cpp
+++ b/occ_manager.cpp
@@ -15,27 +15,11 @@ namespace occ
void Manager::findAndCreateObjects()
{
- // Need to watch for CPU inventory creation.
for (auto id = 0; id < MAX_CPUS; ++id)
{
- auto path = std::string(CPU_PATH) + std::to_string(id);
- cpuMatches.emplace_back(
- bus,
- sdbusRule::interfacesAdded() +
- sdbusRule::argNpath(0, path),
- std::bind(std::mem_fn(&Manager::cpuCreated),
- this, std::placeholders::_1));
- }
-
- // Check if CPU inventory exists already.
- auto occs = open_power::occ::finder::get(bus);
- if (!occs.empty())
- {
- for (const auto& occ : occs)
- {
- // CPU inventory exists already, OCC objects can be created.
- createObjects(occ);
- }
+ // Create one occ per cpu
+ auto occ = std::string(OCC_NAME) + std::to_string(id);
+ createObjects(occ);
}
}
OpenPOWER on IntegriCloud