sdbusplus: 'set' support

Patrick Williams patrick at stwcx.xyz
Thu Jun 18 20:59:07 AEST 2020


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.

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20200618/5c6df964/attachment.sig>


More information about the openbmc mailing list