From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 19:54:50 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A8910656B6 for ; Wed, 23 Apr 2008 19:54:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D77278FC2C for ; Wed, 23 Apr 2008 19:54:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 924761A4D80; Wed, 23 Apr 2008 12:54:49 -0700 (PDT) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m3NJsWx4031333; Wed, 23 Apr 2008 15:54:33 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andriy Gapon Date: Wed, 23 Apr 2008 15:49:54 -0400 User-Agent: KMail/1.9.7 References: <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> <480F8D23.9040005@icyb.net.ua> In-Reply-To: <480F8D23.9040005@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804231549.54722.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 23 Apr 2008 15:54:34 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6905/Wed Apr 23 11:20:18 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 19:54:50 -0000 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