Remove dead host_pdr_handler code & json-file
The content from host_fru.json is being parsed and parents map is being
populated with that data, but the parents map isn't being used anywhere
in the code base making it a dead code, so removing the json file & also
the code that parses it.
This part of code was once added to normalize the PDR's, but now we have
a better/efficient/dynamic way to normalize the PDR's which does not
need any JSON files & static configuration.So we don't need this code
anymore.
Tested:
Code builds & unit tests are passed.
Change-Id: I3c9af49ef3644c08d80e207b86614de1b5b919c2
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/configurations/host/host_frus.json b/configurations/host/host_frus.json
deleted file mode 100644
index 66cfccd..0000000
--- a/configurations/host/host_frus.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "entities": [
- {
- "entity_type": 66,
- "parent": {
- "entity_type": 64,
- "entity_instance": 1
- }
- },
- {
- "entity_type": 67,
- "parent": {
- "entity_type": 64,
- "entity_instance": 1
- }
- }
- ]
-}
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index ea55262..ce41d20 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -98,40 +98,6 @@
oemPlatformHandler(oemPlatformHandler)
{
mergedHostParents = false;
- fs::path hostFruJson(fs::path(HOST_JSONS_DIR) / fruJson);
- if (fs::exists(hostFruJson))
- {
- // Note parent entities for entities sent down by the host firmware.
- // This will enable a merge of entity associations.
- try
- {
- std::ifstream jsonFile(hostFruJson);
- auto data = Json::parse(jsonFile, nullptr, false);
- if (data.is_discarded())
- {
- error("Parsing Host FRU json file failed");
- }
- else
- {
- auto entities = data.value("entities", emptyJsonList);
- for (auto& entity : entities)
- {
- EntityType entityType = entity.value("entity_type", 0);
- auto parent = entity.value("parent", emptyJson);
- pldm_entity p{};
- p.entity_type = parent.value("entity_type", 0);
- p.entity_instance_num = parent.value("entity_instance", 0);
- parents.emplace(entityType, std::move(p));
- }
- }
- }
- catch (const std::exception& e)
- {
- error("Parsing Host FRU json file failed, exception = {ERR_EXCEP}",
- "ERR_EXCEP", e.what());
- }
- }
-
hostOffMatch = std::make_unique<sdbusplus::bus::match_t>(
pldm::utils::DBusHandler::getBus(),
propertiesChanged("/xyz/openbmc_project/state/host0",
diff --git a/host-bmc/host_pdr_handler.hpp b/host-bmc/host_pdr_handler.hpp
index f16dc39..3b05f59 100644
--- a/host-bmc/host_pdr_handler.hpp
+++ b/host-bmc/host_pdr_handler.hpp
@@ -294,7 +294,6 @@
/** @brief list of PDR record handles modified pointing to host PDRs */
PDRRecordHandles modifiedPDRRecordHandles;
- std::map<EntityType, pldm_entity> parents;
/** @brief D-Bus property changed signal match */
std::unique_ptr<sdbusplus::bus::match_t> hostOffMatch;