This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kdbus: restructure name-registry to follow dbus-spec
The DBus Specification [1] is pretty clear about how name-acquisition, queueing and releasing must work. Most of it's peculiarities nobody relies on, but we better comply to them to at least allow proper backwards compatibility via bus-proxy. In particular, this means we don't implement the following details: * NameAcquire must update the stored flags of a name-owner if it is already queued or owns the name. * Only KDBUS_NAME_QUEUE and KDBUS_NAME_ALLOW_REPLACEMENT are stored flags of name owners. Everything else is only used during command execution and/or as reply flags. * NameAcquire on an already queued owner must not change the position in the queue. * KDBUS_NAME_REPLACE_EXISTING for already queued ownes *jumps* the queue if the primary owner has ALLOW_REPLACEMENT set. * If a primary owner is replaced by someone else, they must retain their stored name-flags. * If a primary owner is replaced by someone else, they must be placed at second position in the queue, if queuing is requested. In dbus-daemon the name-owner queue is a single queue. That is, the primary owner of a name is not special, instead, it simply is the first queued owner. This explains most of the peculiarities of the NameAcquire behavior and makes it much easier to implement them. Hence, this patch rewrites the name-registry to follow the lead: * *ANY* name owner is now represented by a "struct kdbus_name_owner" objects, regardless whether they're queued, activators or primary. * All name-ownerships are linked in a *single* list on each connection. This gets rid of redundant conn->queued_names_list and conn->activator_of. * Limits and control functions always apply to 'struct kdbus_name_owner' now, instead of 'struct kdbus_name_entry'. This solves some issues where name-ownership was properly limited, but name-queueing was not. * Activators are now correctly updated regarding KDBUS_NAME_IN_QUEUE depending whether they own the name or not. * owner->flags is now kept clean. Only real requested flags are stored, any operation-flags are cleared. * Special handling of activators is kept to a minimum. This really allows us to treat them more like real queued owners that allow replacement, than something special. With this in place, we follow the dbus-spec regarding behavior of name-acquisition perfectly. Hence, the bus-proxy can properly implement backwards-compatibility to dbus1. [1] http://dbus.freedesktop.org/doc/dbus-specification.html Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
- Loading branch information
David Herrmann
committed
Aug 4, 2015
1 parent
2d3275d
commit 95a9667
Showing
5 changed files
with
486 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.