diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2017-11-12 00:08:03 +0100 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2017-12-08 00:46:26 +0100 |
commit | 363a2cfe957fcc39b616abc390a2aa934f14f46a (patch) | |
tree | 5cdb8c892ff9c64f33733b0c95aa487d4e1e1e7e /libnm-core/nm-utils-private.h | |
parent | e59878ce1911f3930c60a104673b59fb3c5ae001 (diff) | |
download | NetworkManager-363a2cfe957fcc39b616abc390a2aa934f14f46a.tar.gz |
libnm-core: synchronize team.link_watchers when team.config is set.
Diffstat (limited to 'libnm-core/nm-utils-private.h')
-rw-r--r-- | libnm-core/nm-utils-private.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libnm-core/nm-utils-private.h b/libnm-core/nm-utils-private.h index 31196694ca..b7fde275ed 100644 --- a/libnm-core/nm-utils-private.h +++ b/libnm-core/nm-utils-private.h @@ -162,6 +162,30 @@ _nm_utils_json_extract_strv (char *conf, return ret; } +static inline GPtrArray * +_nm_utils_json_extract_ptr_array (char *conf, + _NMUtilsTeamPropertyKeys key, + gboolean is_port) +{ + gs_free GValue *t_value = NULL; + GPtrArray *data, *ret; + guint i; + + ret = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_team_link_watcher_unref); + t_value = _nm_utils_team_config_get (conf, key.key1, key.key2, key.key3, is_port); + if (!t_value) + return ret; + + data = g_value_get_boxed (t_value); + if (!data) + return ret; + + for (i = 0; i < data->len; i++) + g_ptr_array_add (ret, nm_team_link_watcher_dup (data->pdata[i])); + g_value_unset (t_value); + return ret; +} + static inline void _nm_utils_json_append_gvalue (char **conf, _NMUtilsTeamPropertyKeys key, |