commit | 7cc8d00aa97e915475ba74cde071c2db174d990f | [log] [tgz] |
---|---|---|
author | Lei YU <yulei.sh@bytedance.com> | Tue Sep 24 02:33:16 2024 +0000 |
committer | Ed Tanous <ed@tanous.net> | Fri Jan 31 20:30:07 2025 +0000 |
tree | 9ff70a77f9e5bc5995589f053c6f8e9e86536949 | |
parent | 883a8929e3fba37460895d41435b9ae286c5406c [diff] |
Remove default interfaces When association is used, mapper will create DBus objects on the leaf of the associated objects, and will "assign" the "default interfaces" to the parent objects: * org.freedesktop.DBus.Introspectable * org.freedesktop.DBus.Peer * org.freedesktop.DBus.Properties For example, software manager will create BMC version object and create association, and we could see below DBus objects created by mapper: ``` /xyz/openbmc_project/software/64876e4e/inventory /xyz/openbmc_project/software/64876e4e/software_version ``` And we could mapper's `GetObject` method will return the default interfaces on the parent object: ```json # busctl --json=pretty call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetObject sas /xyz/openbmc_project/software/64876e4e 0 { "type" : "a{sas}", "data" : [ { "xyz.openbmc_project.ObjectMapper" : [ "org.freedesktop.DBus.Introspectable", "org.freedesktop.DBus.Peer", "org.freedesktop.DBus.Properties" ], "xyz.openbmc_project.Software.BMC.Updater" : [ "org.freedesktop.DBus.Introspectable", "org.freedesktop.DBus.Peer", "org.freedesktop.DBus.Properties", "xyz.openbmc_project.Association.Definitions", "xyz.openbmc_project.Common.FilePath", "xyz.openbmc_project.Inventory.Decorator.Compatible", "xyz.openbmc_project.Software.Activation", "xyz.openbmc_project.Software.ExtendedVersion", "xyz.openbmc_project.Software.RedundancyPriority", "xyz.openbmc_project.Software.Version" ] } ] } ``` This patch removes registering the default interfaces (peer, properties, Introspectable) when done as part of an ObjectManager event, because they're generally not received as part of an InterfacesAdded call. These don't generally get searched on, and don't make a ton of sense to have the mapper implicitly add, but were done to make the introspect and objectmapper results match. However, the default interfaces returned by introspect on the parents could not be called, e.g. ``` # The leaf object is OK: busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/software/64876e4e/inventory org.freedesktop.DBus.Properties GetAll s org.freedesktop.DBus.Properties a{sv} 0 # The parent object fails to call: busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/software/64876e4e org.freedesktop.DBus.Properties GetAll s org.freedesktop.DBus.Properties Call failed: Unknown object '/xyz/openbmc_project/software/64876e4e'. ``` This probably means that the default interfaces returned by introspect could not really be used, and thus we could remove then in mapper here. Tested: With this patch, the parent object does not show default interfaces: ```json # busctl --json=pretty call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper GetObject sas /xyz/openbmc_project/software/64876e4e 0 { "type" : "a{sas}", "data" : [ { "xyz.openbmc_project.ObjectMapper" : [], "xyz.openbmc_project.Software.BMC.Updater" : [ "org.freedesktop.DBus.Introspectable", "org.freedesktop.DBus.Peer", "org.freedesktop.DBus.Properties", "xyz.openbmc_project.Association.Definitions", "xyz.openbmc_project.Common.FilePath", "xyz.openbmc_project.Inventory.Decorator.Compatible", "xyz.openbmc_project.Software.Activation", "xyz.openbmc_project.Software.ExtendedVersion", "xyz.openbmc_project.Software.RedundancyPriority", "xyz.openbmc_project.Software.Version" ] } ] } ``` Note: if this gets merged, bmcweb's related code in openbmc_dbus_rest.hpp shall be updated to handle this case. Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I568f618141ac514f9720e83960a1b4e76f77eb54
This repository contains the mapper, which assists in finding things on D-Bus. There is documentation about it here.
Non-OpenBMC build dependencies are:
meson build && ninja -C build
meson build && ninja -C build test
rm -rf build