[systemd-devel] [BUG] sd-bus: ObjectManager.InterfacesAdded() and fdo.DBus interfaces

David Herrmann dh.herrmann at gmail.com
Mon Feb 10 07:38:44 PST 2014


Hi

I stumbled over this when trying to use the ObjectManager interface
with sd-bus. Whenever I add new objects, I'm supposed to advertise
them with all supported interfaces. However, sd-bus implements the
org.freedesktop.DBus.XY interfaces internally so I cannot add vtables
for it. This means, sd_bus_emit_interfaces_added() cannot take these
into account. For sd_bus_emit_interfaces_removed() this works as it is
just a shallow wrapper.

I tried fixing that but it's not very easy.
sd_bus_emit_interfaces_added() is also used whenever an existing
object *gains* additional interfaces. So we cannot set the standard
interfaces by default.

I'm now stuck trying to fix it. I have a few ideas:

1) add sd_bus_emit_object_added() which is exactly the same as
sd_bus_emit_interfaces_added() but automatically adds the
org.freedesktop.DBus.XY interfaces supported on the object.

2) make sd_bus_emit_interfaces_added() add the default interfaces
*all* the time. This might work well but will send the
interface-entries uselessly on every call.

3) ignore them. Anyone using ObjectManager() has to use Properties
anyway. I don't know how well this works with gdbus, though. And we'd
also have to add the Introspectable and Peer interfaces there.

Ideas? Or should I just ignore this? I don't really care as I use
interfaces explicitly and not implicitly. But these fancy
language-bindings might care. No idea..

Thanks
David


More information about the systemd-devel mailing list