PEL: Get new references to the event loop
In the EventLogger and Manager classes, have them acquire their own
references to the event loop as opposed to trying to get them from the
bus object.
This is because lately in SDK based testcases, when sdbusplus tries to
create a new sd_bus object, the creation fails and so it isn't possible
to get an sd_event object out of it like the code was trying to do.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I22811f725d44b8c39e68222f3eddb4e87622674f
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index a0c0929..fb0efb3 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -324,10 +324,11 @@
void Manager::scheduleFDClose(int fd)
{
+ sdeventplus::Event event = sdeventplus::Event::get_default();
+
_fdCloserEventSource = std::make_unique<sdeventplus::source::Defer>(
- _logManager.getBus().get_event(),
- std::bind(std::mem_fn(&Manager::closeFD), this, fd,
- std::placeholders::_1));
+ event, std::bind(std::mem_fn(&Manager::closeFD), this, fd,
+ std::placeholders::_1));
}
void Manager::closeFD(int fd, sdeventplus::source::EventBase& source)