sdbusplus reading InterfacesAdded issue: not all variants are created equal

Paul Fertser fercerpav at
Fri Dec 24 02:45:26 AEDT 2021


While digging into current state of SNMP notifications (traps) support
in OpenBMC I found some code I have no idea how to properly improve.

phosphor-dbus-monitor has a handler that's meant to be called whenever
a new log entry is created by monitoring InterfacesAdded signals on
D-Bus logger paths. The processing is at

It seems OK until you look into PathInterfacesAdded definition which
includes a hard-coded std::variant<>:

This already raises suspicions and rightfully so: the interface we're
specifically interested in, xyz.openbmc_project.Logging.Entry,
includes AdditionalData property which should be of type
std::vector<std::string> , but that's not in the list of the allowed
hardcoded variants.

If I'm trying to use the std::variant<> type suitable for
Logging.Entry then fails with InvalidEnum error, probably
trying to parse data about other interfaces, and this is a bad idea

So what is the correct method of using statically-typed sdbusplus APIs
to parse such a "dynamic" reply?

Be free, use free ( software!
mailto:fercerpav at

More information about the openbmc mailing list