Use getSubTreePaths to obtain fan objects that have interface - #76
Merged
Conversation
Collaborator
Author
xyz.openbmc_project.Sensor.Value using Object Mapper. These fan objects are created under service xyz.openbmc_project.FanSensor With the current version of Entity Manager, it does not have support for D-Bus interfaces "Associations" such as cooled_by and it does not support "Exposes" within "Type": "Chassis" Tested: On congo Signed-off-by: Shirish Pargaonkar <Shirish.Pargaonkar@amd.com>
spargaon
force-pushed
the
fwdevel-128967-devel
branch
from
August 7, 2026 22:10
cf8117f to
f9b1ce9
Compare
rajaganeshr
approved these changes
Aug 17, 2026
There was a problem hiding this comment.
Pull request overview
This PR changes fan discovery for Redfish ThermalSubsystem/Fans to query fan tach sensor objects directly from the Object Mapper (via GetSubTreePaths) using the xyz.openbmc_project.Sensor.Value interface, as a workaround for platforms/Entity Manager versions that don’t provide the needed D-Bus Associations/Exposes metadata.
Changes:
- Switch the target fan interface from
xyz.openbmc_project.Inventory.Item.Fantoxyz.openbmc_project.Sensor.Value. - Replace chassis-association-based fan enumeration (
getAssociatedSubTreePaths) with a direct subtree query under/xyz/openbmc_project/sensors/fan_tach.
Suppressed comments (1)
redfish-core/lib/fan.hpp:75
- getFanPaths no longer uses validChassisPath and instead enumerates all fan tach sensors under /xyz/openbmc_project/sensors/fan_tach, so the chassis-scoped Fans collection/instance routes can return fans unrelated to the requested chassis on multi-chassis systems. Also, the error log in this function still says getAssociatedSubTreePaths even though the call is now getSubTreePaths, which can mislead debugging.
inline void getFanPaths(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& /* validChassisPath */,
const std::function<void(const dbus::utility::MapperGetSubTreePathsResponse&
fanPaths)>& callback)
{
dbus::utility::getSubTreePaths(
"/xyz/openbmc_project/sensors/fan_tach",
0,
fanInterface,
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
38
to
+39
| constexpr std::array<std::string_view, 1> fanInterface = { | ||
| "xyz.openbmc_project.Inventory.Item.Fan"}; | ||
| "xyz.openbmc_project.Sensor.Value"}; |
spargaon
requested review from
ASADULLAHAMDGIT
and removed request for
ASADULLAHAMDGIT
August 31, 2026 19:23
ASADULLAHAMDGIT
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested: On congo