Page MenuHomeFreeBSD

QEMU tap-bsd: use user-specified tap device if it already exists
ClosedPublic

Authored by emaste on Oct 21 2015, 9:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 28, 12:37 AM
Unknown Object (File)
Sun, Apr 28, 12:37 AM
Unknown Object (File)
Sat, Apr 27, 8:15 PM
Unknown Object (File)
Mon, Apr 8, 3:29 PM
Unknown Object (File)
Mon, Apr 8, 1:59 PM
Unknown Object (File)
Dec 23 2023, 11:18 AM
Unknown Object (File)
Sep 25 2023, 12:33 AM
Unknown Object (File)
Sep 25 2023, 12:30 AM
Subscribers
None

Details

Reviewers
jhb
royger
Summary

Previously we would try cloning /dev/tap and then setting the name of the cloned result to the provided tap ifname. Instead, just use the provided ifname if it exists.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste retitled this revision from to QEMU tap-bsd: use user-specified tap device if it already exists.
emaste updated this object.
emaste edited the test plan for this revision. (Show Details)
emaste added reviewers: jhb, royger.

hopefully I haven't confused you too much by uploading a QEMU diff to our phabricator :)

net/tap-bsd.c
142

Do we even support this on a cloned tap device? I think it gets whatever name is assigned when it is created and can never be changed. I guess it's fine to let the ioctl fail, but it might be clearer to just strcmp the name with the name from TAPGIFNAME and fail if they don't match?

net/tap-bsd.c
142

Hmm, interesting - I guess this changes the interface name but not the /dev/tap name. I'm not sure what the intended use is, but this is @royger's recent change so we should be able to find that out.

royger edited edge metadata.

LGTM. As spoken on IRC with emaste, we could also strcmp ifname and if it starts with "tap" assume it's already created.

net/tap-bsd.c
142

Yes, only the interface name is changed, the device name stays the same. This is important for Xen because the Xen toolstack expects a specific name for each guest/interface in order to add them to the bridge specified in the config file.

This revision is now accepted and ready to land.Oct 23 2015, 2:17 PM