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 760884 - Expose AppliedConnection for devices on D-Bus
Expose AppliedConnection for devices on D-Bus
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: 697370 nm-1-2
 
 
Reported: 2016-01-20 13:07 UTC by Thomas Haller
Modified: 2016-02-16 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Haller 2016-01-20 13:07:15 UTC
NM always had the logical connotation of an "applied connection" -- contrary to the "settings connection". That is because when you modified a currently active connection, it was implied that the settings don't get applied until you re-activate the connection.

Since bug 724041, this is also properly implemented by core daemon.


Now we have the Reapply D-Bus command to update the applied-connection (bug 758463).




Thus the "applied connection" is a integral part of how NM models settings and activating connections. It should also be exposed to the user via D-Bus. Currently the user doesn't know whether the currently applied connection (still) matches the referenced settings connection.


For that, we should add a D-Bus function NMActiveConnection:GetAppliedConnection() which returns the connection hash. Note that exposing the applied connection this way, is much more lightweight then we do for settings-connection (where a settings-connection has it's own D-Bus object, and NMActiveConnection references only the D-Bus object path.




The implementation is pretty simple and we should not release 1-2 (and Reapply API) without it.
Comment 1 Thomas Haller 2016-02-08 13:45:47 UTC
need also bug 761714
Comment 2 Thomas Haller 2016-02-11 11:50:40 UTC
please review: th/device-applied-connection-bgo760884
Comment 3 Dan Williams 2016-02-12 23:12:11 UTC
I think we need to make it clearer what the Applied Connection really is and how it relates to the Settings Connection and the device's IP4Config and IP6Config.  I don't think the documentation makes it clear enough.

For example, the Reapply() docs don't say anything about settings connections or applied connections, but now they should.

We should document what happens when you pass a connection dict in Reapply(); I assume it updates the *applied* connection and the docs should say that.  They should also say that this makes the applied connection different than the settings connection.  Otherwise, the docs about "version_id" here don't make a lot of sense.

I think we should also clarify the relationship to the ActiveConnection (which is really the SettingsConnection) too.  That has the pointer to the settings connection, but I don't think the docs really say this.  That would help people understand what the Applied and Settings connections are.

We should also make it clearer why a user should care that a version-id might not match.  What would cause that?  eg, something like if two applications modify the device's configuration with Reapply() in close succession, they may not have an up-to-date idea of the device's configuration.  The version-id prevents one application from overwriting the configuration that a different application applied to the device without reading that configuration first.
Comment 4 Thomas Haller 2016-02-13 13:44:49 UTC
(In reply to Dan Williams from comment #3)
> I think we need to make it clearer what the Applied Connection really is and
> how it relates to the Settings Connection and the device's IP4Config and
> IP6Config.  I don't think the documentation makes it clear enough.

Described now in Reapply()


> For example, the Reapply() docs don't say anything about settings
> connections or applied connections, but now they should.

added to Reapply()


> We should document what happens when you pass a connection dict in
> Reapply(); I assume it updates the *applied* connection and the docs should
> say that.  They should also say that this makes the applied connection
> different than the settings connection.  Otherwise, the docs about
> "version_id" here don't make a lot of sense.

done.


> I think we should also clarify the relationship to the ActiveConnection
> (which is really the SettingsConnection) too.  That has the pointer to the
> settings connection, but I don't think the docs really say this.  That would
> help people understand what the Applied and Settings connections are.

added commit "introspection: document the meaning of active connections",
but apart from that, Reapply/GetAppliedConnection doesn't have much to do with
active connections.


> We should also make it clearer why a user should care that a version-id
> might not match.  What would cause that?  eg, something like if two
> applications modify the device's configuration with Reapply() in close
> succession, they may not have an up-to-date idea of the device's
> configuration.  The version-id prevents one application from overwriting the
> configuration that a different application applied to the device without
> reading that configuration first.

Correct. I tried to explain that.



How about now?