[asterisk-dev] Sysfs udev /dev/dahdi/span-names/ population

Kevin P. Fleming kpfleming at digium.com
Sat Jul 24 14:49:05 CDT 2010


On 07/24/2010 03:38 PM, Tzafrir Cohen wrote:
> On Fri, Jul 23, 2010 at 05:01:02PM -0500, Russ Meyerriecks wrote:
>> Tzafrir,
>>   What do you think about removing the "location" and using just  
>> "span_id" as a global unique span identifier?
> 
> Astribanks have two persistant identifiers:
> 
> * Connector string: This basically describes the USB connector you
>   plugged the device into
> * Label: Essentially a serial number. Identifies a specific box.
> 
> Both are useful to identify devices by, as we have seen customers in the
> field. Identifying by the connector rather than the label may be more
> useful for those who want to easily replace one device with another in
> case of a problem.
> 
> So I can't make an easy choice which of those two to present as a span
> ID.

... and this is exactly why sysfs and udev were created. The policy of
which identifier is going to be used by userspace to refer to that
device does belong in the driver (unless of course there is only one
option). The driver should expose the various pieces of information it
has available, and the admin can create a suitable udev rule (probably
by copying an example that would exist in the docs) based on whether
they prefer to use the connector string or the label... or whether they
want to just give the device some completely unrelated name (but be able
to move that name to a replacement device should the need arise).

Please don't put *policy* in the driver; only provide the mechanisms
that are needed to implement the policies, and in cases where it makes
sense, choose a suitable default. Personally, I'd be absolutely fine if
the span device was not created by the driver at all, but was created by
udev rules, so that there was only one place that the logic for how it
should be named would live. This would require installing 'default' udev
rules when dahdi-linux is installed, but then at least there is only
place the admin needs to look to figure out why a device got a
particular name, and only one place to change it.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list