core: separate active and applied connection

System Internals / NetworkManager - Lubomir Rintel [v3.sk] - 18 September 2015 10:32 UTC

Clone the connection upon activation. This makes it safe for the user to modify the original connection while it is activated.

This involves several changes:

- NMActiveConnection gets @settings_connection and @applied_connection. To support add-and-activate, we constructing a NMActiveConnection with no connection set. Previously, we would set the "connection" field to a temporary NMConnection. Now NMManager piggybacks this temporary connection as object-data (TAG_ACTIVE_CONNETION_ADD_AND_ACTIVATE).

- get rid of the functions nm_active_connection_get_connection_type() and nm_active_connection_get_connection_uuid(). From their names it is unclear whether this returns the settings or applied connection. The (few) callers should figure that out themselves.

- rename nm_active_connection_get_id() to nm_active_connection_get_settings_connection_id(). This function is only used internally for logging.

- dispatcher calls now get two connections as well. The applied-connection is used for the connection data, while the settings-connection is used for the connection path.

- needs special handling for properties that apply immediately when changed (nm_device_reapply_settings_immediately()).

06da353 core: separate active and applied connection
src/devices/adsl/nm-device-adsl.c | 4 +-
src/devices/bluetooth/nm-device-bt.c | 2 +-
src/devices/nm-device-bond.c | 4 +-
src/devices/nm-device-bridge.c | 2 +-
src/devices/nm-device-ethernet.c | 43 +--
src/devices/nm-device-infiniband.c | 4 +-
src/devices/nm-device-vlan.c | 6 +-
src/devices/nm-device.c | 249 ++++++++++----
src/devices/nm-device.h | 13 +-
src/devices/team/nm-device-team.c | 6 +-
src/devices/wifi/nm-device-olpc-mesh.c | 2 +-
src/devices/wifi/nm-device-wifi.c | 81 ++---
src/devices/wwan/nm-device-modem.c | 2 +-
src/devices/wwan/nm-modem.c | 11 +-
src/nm-activation-request.c | 152 ++++++---
src/nm-activation-request.h | 19 +-
src/nm-active-connection.c | 177 +++++++---
src/nm-active-connection.h | 19 +-
src/nm-audit-manager.c | 7 +-
src/nm-audit-manager.h | 2 +-
src/nm-default-route-manager.c | 6 +-
src/nm-dispatcher.c | 63 ++--
src/nm-dispatcher.h | 12 +-
src/nm-manager.c | 318 ++++++++++--------
src/nm-manager.h | 4 +-
src/nm-policy.c | 134 +++-----
src/ppp-manager/nm-ppp-manager.c | 35 +-
src/settings/nm-agent-manager.c | 22 +-
src/settings/nm-agent-manager.h | 8 +-
src/settings/nm-settings-connection.c | 559 ++++++++++++++++++++++----------
src/settings/nm-settings-connection.h | 8 +-
src/settings/nm-settings.c | 14 +-
src/settings/nm-settings.h | 2 +-
src/vpn-manager/nm-vpn-connection.c | 168 +++++-----
src/vpn-manager/nm-vpn-connection.h | 4 +-
src/vpn-manager/nm-vpn-manager.c | 7 +-
36 files changed, 1326 insertions(+), 843 deletions(-)

Upstream: cgit.freedesktop.org


  • Share