Subject: Re: vnconfig is broken (was: vnd is broken?)
To: None <current-users@netbsd.org>
From: Rui Paulo <rpaulo@netbsd-pt.org>
List: current-users
Date: 05/10/2005 22:29:10
On 2005-05-10, Steven M. Bellovin <smb@cs.columbia.edu> wrote:
> In message <200505102108.j4AL8xEo023112@guild.plethora.net>, Peter Seebach writ
> es:
>>>Make sure you don't have a file called vnd0 or vnd0d in the current directory
>>.
>>
>>This seems sorta crazy.  I would assume that the sane default would be to
>>assume that I want a device, and the system knows where devices come from.
>>
>>Having vnconfig check . is like having the shell check for a file called
>>"./stdout" if I type "2>&1".  If I want to specify a file in the current
>>directory, I can.
>>
>>This behavior makes the by-far-most-common case unpredictable.  That seems
>>bad.  The Principle of Least Astonishment dictates that devices should be
>>taken from /dev by default.
>
> More to the point -- what is the namespace for the argument? 

From the manpage:

     [...]
FILES
     /dev/rvnd??
     /dev/vnd??
     /etc/disktab


EXAMPLES
           vnconfig vnd0 /tmp/diskimage
     or
           vnconfig /dev/rvnd0c /tmp/diskimage

     Configures the vnode disk vnd0.  Please note that use of the second form
     of the command is discouraged because it requires knowledge of the raw
     partition which varies between architectures.

     [...]

I find useful to get the second argument for -c from the CWD, but not the
first argument. If I really want it to choose a device not in /dev, I would
use a full path. Another approach is: if 'vnd??' is specified for the first
argument, check /dev first and if the file doesn't exists, check for it in
the CWD.

-- 
Rui Paulo <rpaulo@netbsd-pt.org>