Containers (#100344): consider changing instance ID from 'o' to 'x'
Submitted by Simon McVittie
Assigned to D-Bus Maintainers
+++ This bug was initially created as a clone of Bug #100344 +++
Allison would prefer for container instance IDs to be integer handles, as they were in the initial designs at a hackfest. They are currently object paths (but as an implementation detail, the varying part of the object path is in fact a dbus_uint64_t).
Justifications for preferring object paths:
- arg0 matching currently only works on stringy types
- In particular, services that monitor the lifetimes of container instances might well want to match ContainerRemoved signals whose arg0 is a container of interest
- GDBus' API for arg0 matching takes a const gchar *, so matching integers would require new C API (or the caller providing a canonical stringification, but that's an API wart)
- We tell D-Bus API designers to use object paths for their opaque handles (like MPRIS2 tracks, but unlike Telepathy's 32-bit unsigned integer handles, which with hindsight are considered to have been an anti-pattern) and it's a bit hypocritical not to do the same thing ourselves
Justifications for preferring integers:
- They're smaller/more efficient
- We can format them into directory hierarchies, like $XDG_RUNTIME_DIR/containers/%lld/dconf-db, without it resulting in monstrously long filenames
I am not going to change the implementation unless consensus is reached, but I am also intending to leave the implementation counter-based so that switching to dbus_uint64_t would be straightforward.
Version: git master