PEL: Clean up PEL Entry D-bus signals
Don't emit an InterfacesAdded signal when restoring the
org.open_power.Logging.PEL.Entry interface on D-Bus, since this happens
before the bus name is claimed.
Also, don't emit PropertiesChanged signals when the PEL code updates the
Resolution, EventID, and ServiceProviderNotify properties with their
final values on the xyz.openbmc_project.Logging.Entry interface.
Definitely the PC signals aren't necessary during the restore phase, and
while technically it'd be valid to send them after the IA signal has
already been emitted for the Logging.Entry interface, nobody is
listening for them anyway and doing it this way makes it so only
InterfacesAdded signals are emitted when event logs are created.
Change-Id: Ia30163fb58e78d3746015903acc7597b2a097aa4
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index f3487b3..4c90d1e 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -769,7 +769,7 @@
auto entryN = _logManager.entries.find(pel->obmcLogID());
if (entryN != _logManager.entries.end())
{
- entryN->second->resolution(callouts);
+ entryN->second->resolution(callouts, true);
}
}
@@ -782,7 +782,7 @@
auto entry = _logManager.entries.find(obmcLogID);
if (entry != _logManager.entries.end())
{
- entry->second->path(attr.path);
+ entry->second->path(attr.path, true);
}
}
}
@@ -797,12 +797,12 @@
if (entry != _logManager.entries.end())
{
entry->second->serviceProviderNotify(
- attr.actionFlags.test(callHomeFlagBit));
+ attr.actionFlags.test(callHomeFlagBit), true);
}
}
}
-void Manager::createPELEntry(uint32_t obmcLogID)
+void Manager::createPELEntry(uint32_t obmcLogID, bool skipIaSignal)
{
std::map<std::string, PropertiesVariant> varData;
Repository::LogID id{Repository::LogID::Obmc(obmcLogID)};
@@ -836,7 +836,10 @@
// Create Interface for PELEntry and set properties
auto pelEntry = std::make_unique<PELEntry>(_logManager.getBus(), path,
varData, obmcLogID, &_repo);
- pelEntry->emit_added();
+ if (!skipIaSignal)
+ {
+ pelEntry->emit_added();
+ }
_pelEntries.emplace(std::move(path), std::move(pelEntry));
}
}
diff --git a/extensions/openpower-pels/manager.hpp b/extensions/openpower-pels/manager.hpp
index e4c4953..42ce0c4 100644
--- a/extensions/openpower-pels/manager.hpp
+++ b/extensions/openpower-pels/manager.hpp
@@ -61,7 +61,7 @@
setEntryPath(entry.first);
setServiceProviderNotifyFlag(entry.first);
// Create PELEntry interface and setup properties with their values
- createPELEntry(entry.first);
+ createPELEntry(entry.first, true);
}
setupPELDeleteWatch();
}
@@ -419,8 +419,10 @@
* supported
*
* @param[in] obmcLogID - The OpenBMC entry log ID
+ * @param[in] skipIaSignal - If The InterfacesAdded signal should be
+ * skipped after creating the interfaces.
*/
- void createPELEntry(uint32_t obmcLogID);
+ void createPELEntry(uint32_t obmcLogID, bool skipIaSignal = false);
/**
* @brief Reference to phosphor-logging's Manager class
diff --git a/extensions/openpower-pels/pel_entry.hpp b/extensions/openpower-pels/pel_entry.hpp
index 5b36d29..4d1bd6c 100644
--- a/extensions/openpower-pels/pel_entry.hpp
+++ b/extensions/openpower-pels/pel_entry.hpp
@@ -33,7 +33,7 @@
PELEntry(sdbusplus::bus::bus& bus, const std::string& path,
const std::map<std::string, PropertiesVariant>& prop, uint32_t id,
Repository* repo) :
- PELEntryIface(bus, path.c_str(), prop),
+ PELEntryIface(bus, path.c_str(), prop, true),
_obmcId(id), _repo(repo)
{
}
@@ -65,4 +65,4 @@
};
} // namespace pels
-} // namespace openpower
\ No newline at end of file
+} // namespace openpower