Fix failure in setting the PLDM termini effecters
`dbus_to_terminus_effecters.*` files are moved to the platform-mc
folder. The code converts D-Bus set-property actions to PLDM set
terminus effecter command. It will be applied for all PLDM termini, not
only the host.
The change in commit `pldm: Fix build configuration when
libpldmresponder is disabled`[1] is incorrect. It causes a failure in
setting the effecters for PLDM termini in systems with libpldmresponder
option disabled and no hosteid configuration.
About the folder `configuration/host`, it is used regardless of the
enabled/disabled status of libpldmresponder.
This commit corrects the change introduced in [1] to ensure effecters
are set properly even when libpldmresponder is disabled.
Tested:
1. Copy the effecter configuration file to configuration/host
2. The dbus to terminus effecter setting should work correctly.
[1] https://github.com/openbmc/pldm/commit/3b90f7c5d254225f6450ab2547c942d4cfe703ee
Change-Id: I2d87e39fa5a7967314fa30a4df0bd032fb4f50dc
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
diff --git a/meson.build b/meson.build
index 6fa74c7..ddf9efc 100644
--- a/meson.build
+++ b/meson.build
@@ -43,6 +43,9 @@
if cpp.has_header('poll.h')
conf_data.set('PLDM_HAS_POLL', 1)
endif
+
+conf_data.set_quoted('HOST_JSONS_DIR', join_paths(package_datadir, 'host'))
+
if get_option('libpldmresponder').allowed()
conf_data.set_quoted('BIOS_JSONS_DIR', join_paths(package_datadir, 'bios'))
conf_data.set(
@@ -63,7 +66,7 @@
'ENTITY_MAP_JSON',
join_paths(package_datadir, 'entityMap.json'),
)
- conf_data.set_quoted('HOST_JSONS_DIR', join_paths(package_datadir, 'host'))
+
conf_data.set_quoted(
'EVENTS_JSONS_DIR',
join_paths(package_datadir, 'events'),
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index 9387ffe..00da6b2 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -221,6 +221,13 @@
std::unique_ptr<platform_mc::Manager> platformManager =
std::make_unique<platform_mc::Manager>(event, reqHandler, instanceIdDb);
+ std::unique_ptr<pldm::host_effecters::HostEffecterParser>
+ hostEffecterParser =
+ std::make_unique<pldm::host_effecters::HostEffecterParser>(
+ &instanceIdDb, pldmTransport.getEventSource(), pdrRepo.get(),
+ &dbusHandler, HOST_JSONS_DIR, &reqHandler,
+ platformManager.get());
+
#ifdef LIBPLDMRESPONDER
using namespace pldm::state_sensor;
dbus_api::Host dbusImplHost(bus, "/xyz/openbmc_project/pldm");
@@ -250,13 +257,6 @@
if (hostEID)
{
- std::unique_ptr<pldm::host_effecters::HostEffecterParser>
- hostEffecterParser =
- std::make_unique<pldm::host_effecters::HostEffecterParser>(
- &instanceIdDb, pldmTransport.getEventSource(),
- pdrRepo.get(), &dbusHandler, HOST_JSONS_DIR, &reqHandler,
- platformManager.get());
-
hostPDRHandler = std::make_shared<HostPDRHandler>(
pldmTransport.getEventSource(), hostEID, event, pdrRepo.get(),
EVENTS_JSONS_DIR, entityTree.get(), bmcEntityTree.get(),