requester: support multi-host MCTP devices hot plug
Currently, pldmd listens for new MCTP endpoint exposed by mctpd, but
they only shows their EID, Network Id, and SupportedMessageTypes, which
cannot fulfill some requirements, e.g., get the device's name or check
the host slot number which contains the MCTP endpoint in multi-host
system.
In openbmc, the additional information are exposed by Entity Manager,
so that we add ConfigurationDiscoveryHandler, search for Entity
Manager's configuration when a new MCTP endpoint has been register by
mctpd.
Objects who want to obtain the configuration can include the
ConfigurationDiscoveryHandler as their attribute, get the configuration
when needed.
TESTED:
A series of unit test case to simulate the response of dbus call,
confirm that the configurations are successfully stored.
Change-Id: I59b8bf434576cbdea651848a8da11e5b870e2dfa
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: MandyMCHung <mandy.hung.wiwynn@gmail.com>
Signed-off-by: LioraGuo-wiwynn <liora.guo.wiwynn@gmail.com>
Signed-off-by: Unive Tien <unive.tien.wiwynn@gmail.com>
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index fc2b08d..3f200fd 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -7,6 +7,7 @@
#include "fw-update/manager.hpp"
#include "invoker.hpp"
#include "platform-mc/manager.hpp"
+#include "requester/configuration_discovery_handler.hpp"
#include "requester/handler.hpp"
#include "requester/mctp_endpoint_discovery.hpp"
#include "requester/request.hpp"
@@ -244,6 +245,10 @@
}
std::shared_ptr<HostPDRHandler> hostPDRHandler;
std::unique_ptr<DbusToPLDMEvent> dbusToPLDMEventHandler;
+
+ auto configurationDiscovery =
+ std::make_unique<pldm::ConfigurationDiscoveryHandler>(&dbusHandler);
+
std::unique_ptr<platform_config::Handler> platformConfigHandler{};
platformConfigHandler =
std::make_unique<platform_config::Handler>(PDR_JSONS_DIR);
@@ -326,7 +331,9 @@
std::unique_ptr<MctpDiscovery> mctpDiscoveryHandler =
std::make_unique<MctpDiscovery>(
bus, std::initializer_list<MctpDiscoveryHandlerIntf*>{
- fwManager.get(), platformManager.get()});
+ fwManager.get(), platformManager.get(),
+ configurationDiscovery.get()});
+
auto callback = [verbose, &invoker, &reqHandler, &fwManager, &pldmTransport,
TID](IO& io, int fd, uint32_t revents) mutable {
if (!(revents & EPOLLIN))