Skip to content

Use getSubTreePaths to obtain fan objects that have interface - #76

Merged
spargaon merged 1 commit into
integ_sp8from
fwdevel-128967-devel
Sep 1, 2026
Merged

Use getSubTreePaths to obtain fan objects that have interface#76
spargaon merged 1 commit into
integ_sp8from
fwdevel-128967-devel

Conversation

@spargaon

@spargaon spargaon commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator
Use getSubTreePaths to obtain fan objects that have interface
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

@spargaon

spargaon commented Aug 7, 2026

Copy link
Copy Markdown
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
spargaon force-pushed the fwdevel-128967-devel branch from cf8117f to f9b1ce9 Compare August 7, 2026 22:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Fan to xyz.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 thread redfish-core/lib/fan.hpp
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
spargaon requested review from ASADULLAHAMDGIT and removed request for ASADULLAHAMDGIT August 31, 2026 19:23
@spargaon
spargaon merged commit af52cf3 into integ_sp8 Sep 1, 2026
1 check passed
@spargaon
spargaon deleted the fwdevel-128967-devel branch September 1, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants