Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 00:33:47 -0700
From:      Craig Rodrigues <rodrigc@freebsd.org>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r271350 - head/sys/dev/nmdm
Message-ID:  <CAG=rPVfXP7hHhn4xqbou3wphWA37GpT%2Bk1305ohB2qSzG9KR1w@mail.gmail.com>
In-Reply-To: <201409100544.s8A5iGQD035135@svn.freebsd.org>
References:  <201409100544.s8A5iGQD035135@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 9, 2014 at 10:44 PM, Peter Grehan <grehan@freebsd.org> wrote:

> Author: grehan
> Date: Wed Sep 10 05:44:15 2014
> New Revision: 271350
> URL: http://svnweb.freebsd.org/changeset/base/271350
>
> Log:
>   Fix issue with nmdm and leading zeros in device name.
>
>   The nmdm code enforces a number between the 'nmdm' and 'A|B' portions
>   of the device name. This is then used as a unit number, and sprintf'd
>   back into the tty name. If leading zeros were used in the name,
>   the created device name is different than the string used for the
>   clone-open (e.g. /dev/nmdm0001A will result in /dev/nmdm1A).
>
>   Since unit numbers are no longer required with the updated tty
>   code, there seems to be no reason to force the string to be a
>   number. The fix is to allow an arbitrary string between
>   'nmdm' and 'A|B', within the constraints of devfs names. This allows
>   all existing user of numeric strings to continue to work, and also
>   allows more meaningful names to be used, such as bhyve VM names.
>
>   Tested on amd64, i386 and ppc64.
>
>   Reported by:  Dave Smith
>   PR:           192281
>   Reviewed by:  neel, glebius
>   Phabric:      D729
>   MFC after:    3 days
>
>

This works quite well.  I've created this nmdm device:

crw-------  1 root  wheel  0x87 Sep 10 07:30 /dev/nmdmscan-ci.FreeBSD.orgB

and it works.  This is very handy for encoding the name
of the bhyve VM in the nmdm device entry.  Thanks!

--
Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVfXP7hHhn4xqbou3wphWA37GpT%2Bk1305ohB2qSzG9KR1w>