Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2008 15:49:54 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Andriy Gapon <avg@icyb.net.ua>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: devctl (alike?) for devfs
Message-ID:  <200804231549.54722.jhb@freebsd.org>
In-Reply-To: <480F8D23.9040005@icyb.net.ua>
References:  <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> <480F8D23.9040005@icyb.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 23 April 2008 03:25:23 pm Andriy Gapon wrote:
> on 23/04/2008 16:55 John Baldwin said the following:
> > On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote:
> >> Maybe this is a crazy idea or maybe we already have something like this.
> >> Is it possible to get notifications about changes in devfs - appearance
> >> and disappearance of devices (in devfs sense of the word)?
> >> devctl currently notifies about real (hardware) devices handled by
> >> device drivers and some notifications about hardware/driver events.
> >> But what if I want to automatically run some action if
> >> /dev/ufs/magic-label appears?
> >> Or if I want to monitor appearance and disappearance of ad* and da*
> >> devices (without having to monitor low level drivers like umass)?
> > 
> > You would just need to add new hooks to devfs to feed events to devctl 
when 
> > devices come and go.  Other non-new-bus things like ifnet's already do 
this, 
> > so there is precedent.
> > 
> 
> Thank you! This sounds like something rather simple, I'll try to create
> a patch.
> I think it would be a good idea to include "dev/" prefix in device name,
> so that devfs device is not confused with "driver device" (e.g.
> dev/umass0 vs umass0).

Events have a subsystem associated with them, so devfs events would use their 
own subsystem type to avoid that sort of confusion.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804231549.54722.jhb>