After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680909 - Manage interface set up outside of NM on user/admin request [danw/disable]
Manage interface set up outside of NM on user/admin request [danw/disable]
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal enhancement
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
: 743546 (view as bug list)
Depends on: 746566
Blocks:
 
 
Reported: 2012-07-31 14:33 UTC by David Jaša
Modified: 2016-02-15 20:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[patch] danw/no-default-unmanaged (10.78 KB, patch)
2016-02-15 20:49 UTC, Thomas Haller
none Details | Review
[patch] danw/disable (17.18 KB, patch)
2016-02-15 20:51 UTC, Thomas Haller
none Details | Review

Description David Jaša 2012-07-31 14:33:19 UTC
Manage interface set up outside of NM on user/admin request

This is an extension of . Essentially, this is good for situations when user sets up L1/L2 connection details manually (by creating a bridge or running wpa_supplicant manually for instance) but wants NM to take care of connection on IP level.
Comment 1 Pavel Simerda 2012-07-31 17:08:24 UTC
Extension of bug 680908.
Comment 2 Dan Williams 2014-04-22 14:53:20 UTC
So we do have some support for this through "Generic" devices, which are ones NM doesn't natively know the L2 details of.  These include loopback, GRE, macvlan, macvtap, tun, tap, etc.

We want NM to be in a place where it can manage externally created devices but doesn't touch them destructively if they are configured outside NM, but instead picks up these configuration details dynamically.
Comment 3 Dan Winship 2014-04-22 15:09:17 UTC
danw/disable has (old, outdated) patches to make NMDevice:managed be read-write, which basically implements this feature. It would need to be updated for NM_UNMANAGED_FLAGS and probably some other stuff too.
Comment 4 Dan Winship 2014-04-30 19:45:46 UTC
Rebased danw/disable and pushed
Comment 5 Dan Williams 2014-05-05 22:20:46 UTC
This seems more like a 1.0 target if anything, moving there.
Comment 6 Dan Winship 2014-07-10 13:34:51 UTC
Rebased and pushed again.

default-unmanaged is a constant source of trickiness, and I think getting rid of it would be a good thing.

Also, this feature has now been requested downstream too: https://bugzilla.redhat.com/show_bug.cgi?id=1114685
Comment 7 Thomas Haller 2014-07-11 14:19:32 UTC
>> libnm-glib: add nm_device_set_managed()

nm_device_set_*() changing the internal state of NMDevice before actually sending the DBUS command. That seems very wrong... anyway. Not related to this patch. 


>> cli: add "nmcli device manage" and "nmcli device unmanage"

could you add bash-completion for this command?



rest looks good to me
Comment 8 Dan Williams 2014-07-11 20:49:56 UTC
I keep coming back to the fact that we want NM to be able to manage any device it is capable of managing, but shouldn't be destructive if the user doesn't want.  Eventually we should really just get rid of "unmanaged" completely.  At least, that's what I'd love to see.  I don't think this branch gets us there...

What I really want to see from jpirko's use-case is how NM is screwing up whatever he's trying to do outside NM.  Then we fix that and make NM not screw that up.
Comment 9 Dan Winship 2014-07-18 13:30:42 UTC
OK, then consider danw/no-default-unmanaged, which drops default-unmanaged, and just lets NMDeviceGeneric be managed instead (which, since we're supposed to be all non-interfering now, should not cause any regressions).

The branch ended up involving some random cleanup too so it's worth a review even if we're not ready to drop default-unmanaged right now...
Comment 10 Dan Williams 2014-07-19 20:13:43 UTC
I like the cleanups in danw/no-default-unmanaged a lot.  I'd like to do more testing with it next week, but I have no issues with the code in that branch from my review.
Comment 11 Thomas Haller 2014-07-21 13:19:16 UTC
(In reply to comment #8)
> I keep coming back to the fact that we want NM to be able to manage any device
> it is capable of managing, but shouldn't be destructive if the user doesn't
> want.  Eventually we should really just get rid of "unmanaged" completely.  At
> least, that's what I'd love to see.  I don't think this branch gets us there...
> 
> What I really want to see from jpirko's use-case is how NM is screwing up
> whatever he's trying to do outside NM.  Then we fix that and make NM not screw
> that up.

"shouldn't be destructive" is a noble intent at best.
As I said in https://bugzilla.redhat.com/show_bug.cgi?id=1114685#c3 :

--
NM *does* modify any device it manages.

At the very least, it does IFF_UP it, and disable_ipv6. While we might soon get away with leaving disable_ipv6 untouched, NM still will need to up the interface.

That alone does qualifies as "interfering". While it might not be an issue for most users, some users want "unmanaged" to really mean "not interfering at all", hence they need this.
--
Comment 12 Dan Winship 2014-07-21 13:29:16 UTC
(In reply to comment #11)
> "shouldn't be destructive" is a noble intent at best.

yeah, and FTR, the current state of danw/no-default-unmanaged breaks "lo". (It ends up losing its IP addresses at some point for some reason; probably on suspend/resume. And then you have to unset disable_ipv6 before you can re-add ::1 on it.)

(In reply to comment #10)
> I like the cleanups in danw/no-default-unmanaged a lot.

Should I go ahead and commit the bits up to "config: drop NMConfigDevice, use NMDevice directly" now?
Comment 13 Thomas Haller 2014-07-21 14:08:22 UTC
> config: drop NMConfigDevice, use NMDevice directly

such a NMDeviceTest stub seems useful... might be nice to have it in nm-test-utils.h (later).



I also think danw/no-default-unmanaged is good.
Comment 14 Dan Winship 2014-07-23 14:57:22 UTC
(In reply to comment #10)
> I like the cleanups in danw/no-default-unmanaged a lot.

committed the cleanups; the actual no-default-unmanaged changes have issues, as mentioned above
Comment 15 mothra 2014-09-24 20:53:17 UTC
Dan mentioned on IRC to bring this up here but I have found that in my current project (https://github.com/mothran/bunny) as well as other projects: (https://github.com/oblique/create_ap/blob/ec0df440f82e7a0daca10dc1b12a1c85bb47b9d7/create_ap#L242) the ability to grammatically unmanage single devices would be critical for us.  

Mostly this has to do with wireless interfaces that a application might want to take full control over (ad-hoc, monitor mode, ect).  

Thanks,
-Mothra
Comment 16 Dan Winship 2015-01-26 17:30:25 UTC
*** Bug 743546 has been marked as a duplicate of this bug. ***
Comment 17 Thomas Haller 2015-06-02 13:42:04 UTC
Handling of veth devices was refined upstream by bug 731014 (lr/udev-unmanaged-fd731014).

Handling of default-unmanaged also gets cleaned up during bug 746566 (lr/default-unmanaged-bgo746566).

This renders the remainder of danw/no-default-unmanaged mostly obsolete.


I'd say, let's depend this bug to bug 746566, and then close them together.
Comment 18 Thomas Haller 2016-02-15 20:49:32 UTC
Created attachment 321311 [details] [review]
[patch] danw/no-default-unmanaged

Attach the content of danw/no-default-unmanaged branch for history. This branch is obsolete now
Comment 19 Thomas Haller 2016-02-15 20:50:11 UTC
with bug 746566 fixed, this bug can be closed as well.
Comment 20 Thomas Haller 2016-02-15 20:51:48 UTC
Created attachment 321313 [details] [review]
[patch] danw/disable

Also attach branch danw/disable here for history