mapper: Add Associated subtree method definition

dbus-interface change in:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57821

Create new mapper function to make subtree call and association call at
the same time. With the association definition, we will have more
endpoints to fetch and verify that it is actually the resource that we
are looking for. We need to verify that it has the expected interface to
confirm that it is right device. In the current workflow this will take
two dbus calls to the mapper to get the association and the subtree.

This change aims to reduce that down to one by combining the two
operations. It will not significant performance increase for the daemons,
but it can help reduce the load on the dbus-broker.service.

Tested:
```
Normal Call:
busctl call   "xyz.openbmc_project.ObjectMapper" \
    "/xyz/openbmc_project/object_mapper" \
    "xyz.openbmc_project.ObjectMapper" "GetSubTreePaths" sias \
     "/xyz/openbmc_project/inventory" 0 1 \
     "xyz.openbmc_project.Inventory.Item.Storage"
as 4 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1"
     "/xyz/openbmc_project/inventory/storage_4" "/xyz/openbmc_project/inventory/storage_3"

Associated Call: (Only 0 and 1 is associated to the chassis)
busctl call   "xyz.openbmc_project.ObjectMapper" \
    "/xyz/openbmc_project/object_mapper" \
    "xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePaths" ssias \
    "/xyz/openbmc_project/inventory/chassis_0/storage" \
     "/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Storage"
as 2 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1"
```

Change-Id: Ib532e660cf20b9efc83045fb1cbd9143d0c1841e
Signed-off-by: Willy Tu <wltu@google.com>
4 files changed
tree: 3d0ffa4baf856e0b444b03062148011dfbfdd2f0
  1. fail-monitor/
  2. libmapper/
  3. src/
  4. subprojects/
  5. .clang-format
  6. .gitignore
  7. LICENSE
  8. meson.build
  9. meson_options.txt
  10. OWNERS
  11. README.md
README.md

The Mapper

This repository contains the mapper, which assists in finding things on D-Bus. There is documentation about it here.

Prerequisites

Non-OpenBMC build dependencies are:

  • meson/ninja
  • boost
  • libsystemd
  • systemd
  • tinyxml2

Build

meson build && ninja -C build

Run Unit Tests

meson build && ninja -C build test

Clean the repository

rm -rf build