diff options
author | Thomas Haller <thaller@redhat.com> | 2018-11-19 11:16:44 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-11-19 13:04:59 +0100 |
commit | 7420ae831493f451c6601b888685c9cd54de7f34 (patch) | |
tree | 4311ecf06d65fca8ac92dcb30d348dd1bdc08aa1 | |
parent | da05a6b5e5c3db070be3ef459db0e9c2bb9503ac (diff) | |
download | NetworkManager-7420ae831493f451c6601b888685c9cd54de7f34.tar.gz |
all: rename "bind" option for AddAndActivateConnection2 to "bind-activation"
"bind" specifically binds the lifetime of the activation (NMActiveConnection).
In combination with "persist=volatile", the lifetime of the NMSettingsConnection
is indirectly bound to the NMActiveConnection. But still these concepts make sense
independently.
In the future, it may make sense to also bind the lifetime of the NMSettingsConnection
to the D-Bus client. Hence, rename the option to allow for the distinction.
Also, belatedly fix libnm comment about "bind" only working with
"persist" "volatile".
Fixes: eb883e34a5889812d35e5c2d7bc6051723001a3a
-rw-r--r-- | introspection/org.freedesktop.NetworkManager.xml | 2 | ||||
-rw-r--r-- | libnm/nm-client.c | 6 | ||||
-rw-r--r-- | src/nm-manager.c | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/introspection/org.freedesktop.NetworkManager.xml b/introspection/org.freedesktop.NetworkManager.xml index f78a989a4b..5a13211e2e 100644 --- a/introspection/org.freedesktop.NetworkManager.xml +++ b/introspection/org.freedesktop.NetworkManager.xml @@ -129,7 +129,7 @@ parameters. At this time the following options are supported: * persist: A string value of either "disk" (default), "memory" or "volatile". If "memory" is passed, the connection will not be saved to disk. If "volatile" is passed, the connection will not be saved to disk and will be destroyed when disconnected. - * bind: Bind the activation lifetime. Set to "dbus-name" to automatically disconnect when the requesting process disappears from the bus. The default of "none" means the connection is kept activated normally. + * bind-activation: Bind the activation lifetime. Set to "dbus-name" to automatically disconnect when the requesting process disappears from the bus. The default of "none" means the connection is kept activated normally. --> <method name="AddAndActivateConnection2"> <arg name="connection" type="a{sa{sv}}" direction="in"/> diff --git a/libnm/nm-client.c b/libnm/nm-client.c index d37feb100f..50307486bc 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -1304,12 +1304,10 @@ nm_client_add_and_activate_connection_finish (NMClient *client, * * "persist": A string describing how the connection should be stored. * The default is "disk", but it can be modified to "memory" (until * the daemon quits) or "volatile" (will be deleted on disconnect). - * * "bind": Bind the connection lifetime to something. The default is "none", + * * "bind-activation": Bind the connection lifetime to something. The default is "none", * meaning an explicit disconnect is needed. The value "dbus-client" - * means the connection will automatically be closed when the calling + * means the connection will automatically be deactivated when the calling * DBus client disappears from the system bus. - * A non-default "bind" option must always be used together with - * "persist" set to "volatile". * * Since: 1.16 **/ diff --git a/src/nm-manager.c b/src/nm-manager.c index c960155fde..ac863fc59a 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5270,7 +5270,7 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj, "Option \"persist\" must be one of \"volatile\", \"memory\" or \"disk\""); goto error; } - } else if ( nm_streq (option_name, "bind") + } else if ( nm_streq (option_name, "bind-activation") && g_variant_is_of_type (option_value, G_VARIANT_TYPE_STRING)) { s = g_variant_get_string (option_value, NULL); @@ -5281,7 +5281,7 @@ impl_manager_add_and_activate_connection (NMDBusObject *obj, else { error = g_error_new_literal (NM_MANAGER_ERROR, NM_MANAGER_ERROR_INVALID_ARGUMENTS, - "Option \"bind\" must be one of \"dbus-client\" or \"none\""); + "Option \"bind-activation\" must be one of \"dbus-client\" or \"none\""); goto error; } } else { |