Skip to contentSkip to conversation

sdbusplus: 'set' support

DISCUSSION Patrick Williams 1 participant 1 message Jun 18, 2020

lore
Share & tools
lore
#0 lore raw

Hello,

I just merged a commit which adds 'set' as an acceptable type for the dbus interface YAML. This will correspond to 'std::set'[1] but will be sent along dbus as a dbus-array[2]. Thus, filtering of uniqueness will only happen as a result of the underlying C++ type being a set.

I suspect there are items in our phosphor-dbus-interface that are currently represented using an 'array' that would more appropriate communicate intent as a 'set'. I've attempted to search for them below. It would be helpful if domain experts could review the list and determine if any of them should be changed toward 'set'.

```
$ git grep "type: array" | grep -v "\[byte" | grep -v "\[u*int"
com/ibm/VPD/Manager.interface.yaml:          type: array[path]
com/ibm/VPD/Manager.interface.yaml:          type: array[path]
xyz/openbmc_project/Association.interface.yaml:      type: array[path]
xyz/openbmc_project/Certs/CSR/Create.interface.yaml:          type: array[string]
xyz/openbmc_project/Certs/CSR/Create.interface.yaml:          type: array[string]
xyz/openbmc_project/Certs/Certificate.interface.yaml:      type: array[string]
xyz/openbmc_project/Control/FanRedundancy.interface.yaml:      type: array[path]
xyz/openbmc_project/Control/ThermalMode.interface.yaml:      type: array[string]
xyz/openbmc_project/Inventory/Decorator/Compatible.interface.yaml:      type: array[string]
xyz/openbmc_project/Inventory/Item/Dimm.interface.yaml:      type: array[string]
xyz/openbmc_project/Inventory/Item/Dimm.interface.yaml:      type: array[string]
xyz/openbmc_project/Inventory/Item/Dimm/SecurityCapabilities.interface.yaml:      type: array[string]
xyz/openbmc_project/Logging/Create.interface.yaml:          type: array[struct[enum[self.FFDCFormat], byte, byte, unixfd]]
xyz/openbmc_project/Logging/Entry.interface.yaml:      type: array[string]
xyz/openbmc_project/Logging/Event.interface.yaml:      type: array[string]
xyz/openbmc_project/Network/EthernetInterface.interface.yaml:      type: array[string]
xyz/openbmc_project/Network/EthernetInterface.interface.yaml:      type: array[string]
xyz/openbmc_project/Network/EthernetInterface.interface.yaml:      type: array[string]
xyz/openbmc_project/Network/EthernetInterface.interface.yaml:      type: array[string]
xyz/openbmc_project/Network/Experimental/Bond.interface.yaml:      type: array[string]
xyz/openbmc_project/ObjectMapper.interface.yaml:          type: array[string]
xyz/openbmc_project/ObjectMapper.interface.yaml:          type: array[string]
xyz/openbmc_project/ObjectMapper.interface.yaml:          type: array[string]
xyz/openbmc_project/ObjectMapper.interface.yaml:          type: array[path]
xyz/openbmc_project/User/Attributes.interface.yaml:      type: array[string]
xyz/openbmc_project/User/Manager.interface.yaml:          type: array[string]
xyz/openbmc_project/User/Manager.interface.yaml:      type: array[string]
xyz/openbmc_project/User/Manager.interface.yaml:      type: array[string]
```

1. If you are curious why this does not correspond to 'std::unordered_set', see the commit message at
https://github.com/openbmc/sdbusplus/commit/b98bdc6fafa9d60596cd06ff708ef3baeeb3c959

2. There was existing code in sdbusplus that turned 'std::set' into a dbus-array, so if you are making direct 'sdbusplus::message' calls you could have already done this. What I've done here is add support to the sdbus++ binding generator.

Signature · 1 line
Patrick Williams