Re: [Utopia] kernel -> dbus event delivery?



On Fri, Jul 09, 2004 at 01:39:54AM +0200, Kay Sievers wrote:
> On Thu, Jul 08, 2004 at 10:34:18AM -0400, Robert Love wrote:
> > On Thu, 2004-07-08 at 13:12 +0200, Kay Sievers wrote:
> > 
> > > does anybody know about the current state of the kernel<->dbus event-link?
> > > Is there anything I can play with :) The only reference I could find, is
> > > Arjan's patch:
> > >   http://people.redhat.com/arjanv/linux-2.6.0-dbus.patch
> > > 
> > > What is the glue between the kernels NETLINK_DBUS and the dbus-daemon?
> > 
> > The work is a bit stagnate because I don't have overwhelming support
> > from the community.  Also, we have not found any huge needs for an
> > asynchronous event system - processor over[h]eating, not withstanding.
> > It will be nice to send up file system events so we don't have to pull
> > mtab, et al, but that is an optimization and not a requirement.
> > 
> > Oh, some IBM guys are super interested, as a mechanism to provide event
> > logging from drivers.
> > 
> > I will be talking at OLS on the event system and D-BUS, so hopefully I
> > can attract some attention.
> > 
> > Anyhow, my latest patch is here:
> > 
> > http://www.kernel.org/pub/linux/kernel/people/rml/events/
> 
> For those, who want to play with it, here is a updated patch that applies
> to the current linux tree and a small listening example:
> 
>   [root pim src]# ./kdbus
>   service 'org.kernel.fs.mount' sent value '/dev/hda3 on /mnt/tmp/'
>   service 'org.kernel.fs.unmount' sent value '/dev/hda3 from foo'
>   service 'org.kernel.drivers.cdrom.media' sent value 'hdc changed'

Here is the next round. I've made a small bridge from the netlink socket
to the dbus-system-daemon. Everything needed, you can get from here:

  http://vrfy.org/projects/kdbusd/

Just patch your kernel, install the dbus-policy, compile and run './kdbusd' and
watch the emitted dbus-events with 'python kernel-listen.py', while mounting a
filesystem or putting a media in your CDROM. Easy, isnt't it :)

here is what I've learned last night:
  The netlink event delivery is a really nice architecture. It's pretty
  much easy as listen for UDP packets on a network socket. You need to be
  root, just open the socket and wait for the incoming messages. The
  kernel sends the messages as multicast, so it's possible to have
  _multiple_ listeners for the same message. The kernel generated message is
  sent to one of 32 possible multicast groups, a client can subscribe to (look
  at groups in kdbusd),

naming:
  As the composed message has nothing to do with dbus, and any low
  level thing may listen directly to the kernel, shouldn't be the kernel
  part renamed to 'uevent', 'eventlink' or something better?

message format
  I want to be able to send hotplug messages on a new group, so what is the
  best raw format to compose it. We need to pass several key value pairs, like
  we do in the environment of the hotplug call today. Should the strings be:
    'KEY=value\0KEY2=value2\0', or should we use
    'KEY:value\nKEY2:value2\n\n', like the mail header format?
  (As a proof of the concept, I will probably convert udevd to listen on the
   socket, instead of getting the message by the forked udevsend helper)

Thanks,
Kay




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]