Currently the devfs cloning of /dev/tap creates a new tap interface on each
open. For some applications (e.g. hypervisors) it would be nice to have an
easy way to allocate a "free" tap interface without creating a new tap
interface each time. This change adds an option (off by default) to allow
an open of /dev/tap to reuse an existing tap interface that is not open by
One caveat is that I don't see an easy way to prevent a race between another
process attempting to open /dev/tap or explicitly opening the same existing
tap interface by name. Ideally an open of /dev/tap should never fail.
Unfortunately, the devfs cloning mechanism is also invoked for non-open cases.