From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 25 18:46:33 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C77E616A420 for ; Sat, 25 Feb 2006 18:46:33 +0000 (GMT) (envelope-from nielsen-list@memberwebs.com) Received: from mail.npubs.com (npubs.com [209.66.100.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0D7743D55 for ; Sat, 25 Feb 2006 18:46:32 +0000 (GMT) (envelope-from nielsen-list@memberwebs.com) From: Nate Nielsen User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <20060222190919.C6B9FDCA99B@mail.npubs.com> <20060224.112310.48529779.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-Id: <20060225185629.E0BA1DCAA41@mail.npubs.com> X-Virus-Scanned: ClamAV using ClamSMTP Date: Sat, 25 Feb 2006 18:56:30 +0000 (GMT) Cc: freebsd-hackers@freebsd.org Subject: Re: devctl attach/detach notification for disks X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nielsen@memberwebs.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2006 18:46:33 -0000 M. Warner Losh wrote: > In message: <20060222190919.C6B9FDCA99B@mail.npubs.com> > Nate Nielsen writes: > : I'm working on a bit of code to get devctl notifications for attaching > : and removing of disks. This would allow actions to be taken via devd > : when a disk is attached or removed from the system. > > I'm not sure I like the API changes you've made to subr_bus. Why are > they needed? Currently the memory passed to devctl_queue_data is required to be allocated via M_BUS, which is declared static in subr_bus.c. The other option would be to put the M_BUS declaration in bus.h. > : Currently I have the attach and detach notifications hooked into > : disk_create() and disk_destroy() in geom_disk.c. See attached (rough) > : patch. > : > : However at these points the disks are not yet present in the /dev/ > : filesystem. Anyone have any clues or tips for a better place to hook > : these notifications into the system? > > That's one of the main reasons that this hasn't happened yet. The > hard part is getting all of the devices in place before sending > notifications. Robert Watson had a similar thing that I think solved > some of the problems a little better... K, well I guess this is out of my scope then. I'll just watch for umassX and other plugabble diskish devices, and then configure them after a 5 second delay or something. Cheers, Nate