The code in connect_hook incorrectly checks for dbus_bus_request_name failure.
The dbus_bus_request_name error indicator is -1, not 0. This leads
to subsequent assertion failure in libdbus.
If message iterator cannot be created, the caller didn't supply any
parameters. Return BadValue, instead of dying a horrible death while being
stuck in an endless loop.
Use uint32s instead of int32s where practical, and add an API version
request. Also, try to return all devices added, not just the first,
and box device arguments.
Break up D-Bus into two components: a D-Bus core that can be used by any
part of the server (for the moment, just the D-Bus hotplug API, and the
forthcoming HAL hotplug API), and the old D-Bus hotplug API.