Use ObjectMapper in Dcmihandler for PowerCap interface
Gaurav Gandhi
gauravgandhi at google.com
Thu Feb 10 11:03:38 AEDT 2022
Hi Everyone,
Currently in dcmihandler object path
<https://github.com/openbmc/phosphor-host-ipmid/blob/4cc61e0e99c9014d2e8d8b25ec52b71c3c4e405b/dcmihandler.cpp#L25>
for PCAP_INTERFACE
<https://github.com/openbmc/phosphor-host-ipmid/blob/4cc61e0e99c9014d2e8d8b25ec52b71c3c4e405b/dcmihandler.cpp#L26>
is hardcoded to get settings service. It was discussed earlier in this
review
<https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/46157>
that
this needs to be more dynamic.
Currently I have 2 options to resolve this:
1. instead of getting a specific service
<https://github.com/openbmc/phosphor-host-ipmid/blob/4cc61e0e99c9014d2e8d8b25ec52b71c3c4e405b/dcmihandler.cpp#L74>
with
a hardcoded path, set/getPcap should call getAllDbusObjects
<https://github.com/openbmc/phosphor-host-ipmid/blob/4cc61e0e99c9014d2e8d8b25ec52b71c3c4e405b/libipmid/utils.cpp#L270>.
This will give an object tree and we have to iterate through all the
objects implementing the powercap interface. I am not sure if this is safe
to do so. Need input from the maintainers.
2. Another option is to add a compile time flag to select a path.
Please let me know what you think.
-
Thanks,
Gaurav
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20220209/afae052b/attachment-0001.htm>
More information about the openbmc
mailing list