summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-12 14:12:23 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-27 08:25:12 -0600
commit17ed2ed18c774878f20fed3cf033f900794827ed (patch)
treee0c55eff0d9ba625da0e9b0fa58bc7172d1ae966 /extensions/openpower-pels
parent5c350fdfb1a92ebdf33d960cc69ac16413974889 (diff)
downloadphosphor-logging-17ed2ed18c774878f20fed3cf033f900794827ed.tar.gz
phosphor-logging-17ed2ed18c774878f20fed3cf033f900794827ed.zip
PEL: Create the PLDMInterface class
Create the PLDMInterface class and pass it into the constructor of the Manager class. This is done at this level so that it can be easily mocked for testing. Add a --enable-dont-send-pels-to-host configure option for systems that don't need PELs sent to the host. If this is set, then don't create and pass in the PLDMInterface class, and then the Manager class won't create a HostNotifier class to do the sending. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I34059470ee117e65c5c02b684a9d916571135bfd
Diffstat (limited to 'extensions/openpower-pels')
-rw-r--r--extensions/openpower-pels/entry_points.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/extensions/openpower-pels/entry_points.cpp b/extensions/openpower-pels/entry_points.cpp
index b454d37..5c6e714 100644
--- a/extensions/openpower-pels/entry_points.cpp
+++ b/extensions/openpower-pels/entry_points.cpp
@@ -17,6 +17,7 @@
#include "elog_entry.hpp"
#include "extensions.hpp"
#include "manager.hpp"
+#include "pldm_interface.hpp"
namespace openpower
{
@@ -32,7 +33,15 @@ void pelStartup(internal::Manager& logManager)
std::unique_ptr<DataInterfaceBase> dataIface =
std::make_unique<DataInterface>(logManager.getBus());
+#ifndef DONT_SEND_PELS_TO_HOST
+ std::unique_ptr<HostInterface> hostIface = std::make_unique<PLDMInterface>(
+ logManager.getBus().get_event(), *(dataIface.get()));
+
+ manager = std::make_unique<Manager>(logManager, std::move(dataIface),
+ std::move(hostIface));
+#else
manager = std::make_unique<Manager>(logManager, std::move(dataIface));
+#endif
}
REGISTER_EXTENSION_FUNCTION(pelStartup);
OpenPOWER on IntegriCloud