tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Specifying names for tap interfaces



> Well in Linux you can give any name to tap interfaces

And other interfaces, IIRC.

This is something I've never liked about Linux, though I'm not entirely
sure why.

> Qemu opens /dev/tap and creates a new /dev/tapX, then fetches the
> name of this interface using the TAPGIFNAME.  In the past, Qemu had a
> parameter that you could use to set the bridge Qemu has to pass to
> the hotplug script, but this is no longer present, and the script
> Qemu calls after creating the interface only knows the name of the
> newly created interface, which is not really helpful, [...]

So, the problem is that the tap unit is not known until Qemu starts,
and Qemu provides no way to associate that interface with other
attributes of the particular Qemu instance that created it, and under
Linux this is addressed by hiding that information in the interface
name.  This strikes me as horrible design, abusing the interface name,
of all things, to pass information through Qemu; it would be much
cleaner to give Qemu arguments which it passes verbatim to the script.

Hm, it occurs to me that in a sense that's what the design is now.  Is
there any reason the `interface name' has to actually be an interface
name?  Could we let Qemu think it's an interface name but have it
actually have nothing to do with any interface name?

> Wouldn't it be possible to create a network interface with a random
> name, that still points to (169,N), even if N is not part of the
> name?

Well, that (169,N) points to - for the most part the pointer goes the
other way.

>> Overall, it seems easiest to teach qemu to use 'ifconfig tapN
>> create' as an alternative to clone/set-name.
> I'm not really sure using an external command is better than
> performing a set of ioctls, it's much more trickier to catch errors,

It is, however, immensely more flexible.

> and I would say that overall I doubt Qemu developers would ever agree
> to switching from using /dev/tap to ifconfig.

I don't know Qemu developers at all, but are they interested in a clean
design that is reasonably portable, or do they think Linux is all they
care to bother with and if it happens to work on something else that's
fine but of no particular value to them?  If they're closer to the
former end of that spectrum, surely we can work out something that's
not too gross for both us and Linux.  (And if they're more towards the
latter, then we'll probably have to have private patches anyway.)

Actually, part of the problem is that inteface names are a separate
namespace unto themselves.  It occurs to me that what we want here is,
loosely put, a symlink for an interface name - but symlinks are
filesystem objects, and interface names have nothing to do with the
filesystem.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index