mapper: should it add "default interfaces" and is it valid to implement no interfaces on an object?

Matt Spinler mspinler at linux.ibm.com
Thu Oct 31 06:49:40 AEDT 2024


On 10/30/2024 1:49 PM, Patrick Williams wrote:
> On Wed, Oct 30, 2024 at 03:00:01PM +0800, Lei Yu wrote:
>> ```
>> # busctl -j call xyz.openbmc_project.ObjectMapper
>> /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper
>> GetObject sas /xyz/openbmc_project/software/c172a378 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",
>>                                  ...
>>                          ]
>>                  }
>>          ]
>> }
>> ```
>>
>> If we introduce the change in
>> https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/74832, the
>> above command will get this result:
>> ```
>> # busctl -j call xyz.openbmc_project.ObjectMapper
>> /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper
>> GetObject sas /xyz/openbmc_project/software/c172a378 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",
>>                                  ...
>>                          ]
>>                  }
>>          ]
>> }
>> ```
>>
>> Note that it indicates that `xyz.openbmc_project.ObjectMapper` service
>> implements **NO** interface on the object.
> This is very strange.  I don't know why mapper would be creating
> these interfaces on objects that don't exist.  It would be reasonable to
> create these on the association objects, since those are actually being
> created by mapper.

Looks like  every D-Bus service works the same way - if the path only 
has the 3 interfaces,
then the GetAll properties method doesn't work:

```
# busctl introspect xyz.openbmc_project.Software.BMC.Updater 
/xyz/openbmc_project
NAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface -         - -
.Introspect                         method    -         s -
org.freedesktop.DBus.Peer           interface -         - -
.GetMachineId                       method    -         s -
.Ping                               method    -         - -
org.freedesktop.DBus.Properties     interface -         - -
.Get                                method    ss        v -
.GetAll                             method    s         a{sv} -
.Set                                method    ssv       - -
.PropertiesChanged                  signal    sa{sv}as  - -


# busctl call xyz.openbmc_project.Software.BMC.Updater
  /xyz/openbmc_project org.freedesktop.DBus.Properties
GetAll s org.freedesktop.DBus.Properties

Call failed: Unknown object '/xyz/openbmc_project'.

```


>
> Why is mapper creating interfaces anywhere except where the association
> itself lives?  I don't think deleting the "DefaultInterfaces" is
> necessarily appropriate because those interfaces _should_ be created on
> the association leaf, but elsewhere in the hierarchy they don't belong.
>
> On my system if I introspect the `/xyz/openbmc_project/software/XXXX` in
> mapper, I see only the 3 `org.freedesktop.DBus` interfaces.  If I
> introspect the `/xyz/openbmc_project/software/XXXX/software_version` I
> see those 3 plus an `xyz.openbmc_project.Assocation` interface.  Only
> the `.../software_version` one should have the `org.freedesktop.DBus`
> interfaces.
>
> What I don't know is if this code you've changed is where those
> interfaces are created (probably not).  So your change might not be
> appropriate for solving the underlying issue, which is that we have
> interfaces that don't belong being created on dbus independent from the
> mapper response.
>



More information about the openbmc mailing list