summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/test-bus-objects.c
AgeCommit message (Collapse)Author
2015-07-27sd-bus: fix path of object-manager signalsDavid Herrmann
Each signal of the ObjectManager interface carries the path of the object in question as an argument. Therefore, a caller will deduce the object this signal is generated for, by parsing the _argument_. A caller will *not* use the object-path of the message itself (i.e., message->path). This is done on purpose, so the caller can rely on message->path to be the path of the actual object-manager that generated this signal, instead of the path of the object that triggered this signal. This commit fixes all InterfacesAdded/Removed signals to use the path of the closest object-manager as message->path. 'closest' in this case means closest parent with at least one object-manager registered. This fix raises the question what happens if we stack object-managers in a hierarchy. Two implementations are possible: First, we report each object only on the nearest object-manager. Second, we report it on each parent object-manager. This patch chooses the former. This is compatible with other existing ObjectManager implementations, which are required to call GetManagedObjects() recursively on each object they find, which implements the ObjectManager interface.
2015-07-09sd-bus: include queried path in GetManagedObjectsDavid Herrmann
If GetManagedObjects is called on /foo/bar, then it should also include the object /foo/bar, if it exists. Right now, we only include objects underneath /foo/bar/. This follows the behavior of existing dbus implementations. Obsoletes #527 and fixes #525. Reported by: Nathaniel McCallum
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2014-12-30bus: add sd_bus_emit_object_{added/removed}()David Herrmann
This implements two new helpers, discussed on systemd-devel about 1 year ago: sd_bus_emit_object_added() sd_bus_emit_object_removed() Both calls are equivalent to their respective counterpart sd_bus_emit_interfaces_{added/removed}(), but can figure out the list of interfaces themselves, instead of requiring the caller to provide them. Furthermore, both calls properly deal with builtin interfaces provided via org.freedesktop.DBus.* and alike. Both calls simply traverse a node and all its parent nodes to figure out a list of all interfaces registered as vtable or fallback. It then appends each of them, similar to the interfaces_{added/removed}() helpers. Note that interfaces_{added/removed}() runs a parent traversal for *each* passed interface. Therefore, it can simply bail out, once it found a parent node that implements a given interface. With object_{added/removed}() we cannot know the registered interfaces in advance, thus, we cannot run one traversal per node. Instead, we run a single traversal and remember all interfaces that we added. Therefore, a child-interface overrides all conflicting parent-interfaces. We keep a "Set *s" context to track those while climbing up the tree.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-14busctl: introduce busctl "get-property" command for reading and dumping ↵Lennart Poettering
object properties
2014-05-15sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering
attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
2014-01-21libsystemd: split up into subdirsTom Gundersen
We still only produce on .so, but let's keep the sources separate to make things a bit less messy.