platform: give the platform an opportunity to override default-unmanaged

System Internals / NetworkManager - Lubomir Rintel [v3.sk] - 23 March 2015 09:13 UTC

Some out of tree drivers add Ethernet devices that are supposed to be managed by other their tooling, e.g. VirtualBox or VMWare.

Rather than hardcoding their drivers (at least VirtualBox doesn't even set a "driver" property in sysfs) or hardcoding a logic that identifies such devices let's just add a possibility to blacklist them in udev. This makes it possible for whoever who ships such a driver to ship rules that prevent NetworkManager from managing the device itself.

Furthermore it makes it possible for the user with special needs leverage the flexibility of udev rules to override the defaults. In the end the user can decide to let NetworkManager manage default-unmanaged interfaces such as VEth or turn on default-unmanaged for devices on a particular bus.

An udev rule for VirtualBox would look like this:

SUBSYSTEM=="net", ENV{INTERFACE}=="vboxnet[0-9]*", ENV{NM_UNMANAGED}="1"

85ee1f4 platform: give the platform an opportunity to override default-unmanaged
man/NetworkManager.xml | 28 ++++++++++++++++++++++++++++
src/nm-manager.c | 5 ++++-
src/platform/nm-fake-platform.c | 7 +++++++
src/platform/nm-linux-platform.c | 15 +++++++++++++++
src/platform/nm-platform.c | 19 +++++++++++++++++++
src/platform/nm-platform.h | 2 ++
6 files changed, 75 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share