summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-06-11 14:39:55 +0200
committerJiří Klimeš <jklimes@redhat.com>2015-06-11 15:05:55 +0200
commit71147612d1608c1fd5defe503c089f02fb467da6 (patch)
tree6c361944eaf2d515d7570c3ae5564158ac6a2c29
parent4779745ea8b77cb7b03ab659f26083c81139b9a0 (diff)
downloadNetworkManager-71147612d1608c1fd5defe503c089f02fb467da6.tar.gz
fixup! libnm: add autoconnect-slaves property to NMSettingConnection
- split DEFAULT to DEFAULT_NO and DEFAULT_YES
-rw-r--r--libnm-core/nm-setting-connection.c14
-rw-r--r--libnm-core/nm-setting-connection.h8
2 files changed, 14 insertions, 8 deletions
diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c
index 3ab8873dcf..57a5fb8128 100644
--- a/libnm-core/nm-setting-connection.c
+++ b/libnm-core/nm-setting-connection.c
@@ -621,7 +621,7 @@ nm_setting_connection_is_slave_type (NMSettingConnection *setting,
NMSettingConnectionAutoconnectSlaves
nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting)
{
- g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT);
+ g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_NO);
return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect_slaves;
}
@@ -1594,10 +1594,12 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
* Whether or not slaves of this connection should be automatically brought up
* when NetworkManager activates this connection. This only has a real effect
* for master connections.
- * The permitted values are: 0: leave slave connections untouched,
- * 1: activate all the slave connections with this connection, -1: default.
- * If -1 (default) is set, global connection.autoconnect-slaves is read to
- * determine the real value. If it is default as well, this fallbacks to 0.
+ * The permitted values are: 0: no = leave slave connections untouched,
+ * 1: yes = activate all the slave connections with this connection,
+ * -2: default no, -1: default yes.
+ * If -2 or -1 (default) is set, global connection.autoconnect-slaves is read to
+ * determine the real value. If it is default as well, this fallbacks to 0 (for -2)
+ * or to 1 (for -1).
*
* Since: 1.2
**/
@@ -1613,7 +1615,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class)
(object_class, PROP_AUTOCONNECT_SLAVES,
g_param_spec_enum (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, "", "",
NM_TYPE_SETTING_CONNECTION_AUTOCONNECT_SLAVES,
- NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT,
+ NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_NO,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
NM_SETTING_PARAM_FUZZY_IGNORE |
diff --git a/libnm-core/nm-setting-connection.h b/libnm-core/nm-setting-connection.h
index 0f502c955e..aa0012ec28 100644
--- a/libnm-core/nm-setting-connection.h
+++ b/libnm-core/nm-setting-connection.h
@@ -64,7 +64,10 @@ G_BEGIN_DECLS
/* Types for property values */
/**
* NMSettingConnectionAutoconnectSlaves:
- * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT: default value
+ * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_NO: default value
+ (no for missing global default)
+ * @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_YES: default value
+ (yes for missing global default)
* @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO: slaves are not brought up when
* master is activated
* @NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES: slaves are brought up when
@@ -74,7 +77,8 @@ G_BEGIN_DECLS
* should be activated when master is activated.
*/
typedef enum {
- NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT = -1,
+ NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_NO = -2,
+ NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT_YES = -1,
NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO = 0,
NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES = 1,
} NMSettingConnectionAutoconnectSlaves;