From afcd268ea7b1149fbfb66bce4eca659b675da0a2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 12 Dec 2017 15:53:07 +0100 Subject: New upstream version 1.10.2 --- libnm/NetworkManager.h | 3 +- libnm/generate-setting-docs.py | 4 +- libnm/libnm.ver | 110 +++++++++++++++++++++++ libnm/nm-manager.c | 2 +- libnm/nm-object.c | 6 +- libnm/nm-property-docs.xml | 26 ++++++ libnm/nm-remote-connection.c | 170 ++++++++++++++++++++++++++++------- libnm/nm-remote-connection.h | 13 +++ libnm/nm-settings-docs-overrides.xml | 2 + libnm/nm-settings-docs.xml | 26 ++++++ libnm/nm-settings-ifcfg-rh-docs.xml | 17 ++-- libnm/nm-settings-keyfile-docs.xml | 2 + 12 files changed, 339 insertions(+), 42 deletions(-) (limited to 'libnm') diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h index 27737e0e..2bdd2ed9 100644 --- a/libnm/NetworkManager.h +++ b/libnm/NetworkManager.h @@ -15,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2014 Red Hat, Inc. + * Copyright 2014 - 2017 Red Hat, Inc. */ #ifndef __NETWORKMANAGER_H__ @@ -84,6 +84,7 @@ #include "nm-setting-pppoe.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" +#include "nm-setting-tc-config.h" #include "nm-setting-team.h" #include "nm-setting-team-port.h" #include "nm-setting-tun.h" diff --git a/libnm/generate-setting-docs.py b/libnm/generate-setting-docs.py index aa0c96eb..f888ff22 100755 --- a/libnm/generate-setting-docs.py +++ b/libnm/generate-setting-docs.py @@ -14,7 +14,7 @@ # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA. # -# Copyright 2009 - 2014 Red Hat, Inc. +# Copyright 2009 - 2017 Red Hat, Inc. from __future__ import print_function @@ -54,10 +54,12 @@ dbus_type_name_map = { 'ay': 'byte array', 'a{ss}': 'dict of string to string', 'a{sv}': 'vardict', + 'aa{sv}': 'array of vardict', 'aau': 'array of array of uint32', 'aay': 'array of byte array', 'a(ayuay)': 'array of legacy IPv6 address struct', 'a(ayuayu)': 'array of legacy IPv6 route struct', + 'aa{sv}': 'array of vardict', } ns_map = { diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 18ff993d..7646a931 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1221,3 +1221,113 @@ global: nm_setting_wireless_security_pmf_get_type; nm_setting_wireless_security_wps_method_get_type; } libnm_1_8_0; + +libnm_1_10_2 { +global: + nm_remote_connection_update2; + nm_remote_connection_update2_finish; + nm_settings_update2_flags_get_type; + nm_setting_tc_config_add_qdisc; + nm_setting_tc_config_add_tfilter; + nm_setting_tc_config_clear_qdiscs; + nm_setting_tc_config_clear_tfilters; + nm_setting_tc_config_get_num_qdiscs; + nm_setting_tc_config_get_num_tfilters; + nm_setting_tc_config_get_qdisc; + nm_setting_tc_config_get_tfilter; + nm_setting_tc_config_get_type; + nm_setting_tc_config_new; + nm_setting_tc_config_remove_qdisc; + nm_setting_tc_config_remove_qdisc_by_value; + nm_setting_tc_config_remove_tfilter; + nm_setting_tc_config_remove_tfilter_by_value; + nm_setting_team_add_link_watcher; + nm_setting_team_add_runner_tx_hash; + nm_setting_team_clear_link_watchers; + nm_setting_team_get_link_watcher; + nm_setting_team_get_mcast_rejoin_count; + nm_setting_team_get_mcast_rejoin_interval; + nm_setting_team_get_notify_peers_count; + nm_setting_team_get_notify_peers_interval; + nm_setting_team_get_num_link_watchers; + nm_setting_team_get_num_runner_tx_hash; + nm_setting_team_get_runner; + nm_setting_team_get_runner_active; + nm_setting_team_get_runner_agg_select_policy; + nm_setting_team_get_runner_fast_rate; + nm_setting_team_get_runner_hwaddr_policy; + nm_setting_team_get_runner_min_ports; + nm_setting_team_get_runner_sys_prio; + nm_setting_team_get_runner_tx_balancer; + nm_setting_team_get_runner_tx_balancer_interval; + nm_setting_team_get_runner_tx_hash; + nm_setting_team_port_add_link_watcher; + nm_setting_team_port_clear_link_watchers; + nm_setting_team_port_get_lacp_key; + nm_setting_team_port_get_lacp_prio; + nm_setting_team_port_get_link_watcher; + nm_setting_team_port_get_num_link_watchers; + nm_setting_team_port_get_prio; + nm_setting_team_port_get_queue_id; + nm_setting_team_port_get_sticky; + nm_setting_team_port_remove_link_watcher; + nm_setting_team_port_remove_link_watcher_by_value; + nm_setting_team_remove_link_watcher; + nm_setting_team_remove_link_watcher_by_value; + nm_setting_team_remove_runner_tx_hash; + nm_setting_team_remove_runner_tx_hash_by_value; + nm_tc_action_dup; + nm_tc_action_equal; + nm_tc_action_get_attribute; + nm_tc_action_get_attribute_names; + nm_tc_action_get_kind; + nm_tc_action_get_type; + nm_tc_action_new; + nm_tc_action_ref; + nm_tc_action_set_attribute; + nm_tc_action_unref; + nm_tc_qdisc_dup; + nm_tc_qdisc_equal; + nm_tc_qdisc_get_handle; + nm_tc_qdisc_get_kind; + nm_tc_qdisc_get_parent; + nm_tc_qdisc_get_type; + nm_tc_qdisc_new; + nm_tc_qdisc_ref; + nm_tc_qdisc_set_handle; + nm_tc_qdisc_unref; + nm_tc_tfilter_dup; + nm_tc_tfilter_equal; + nm_tc_tfilter_get_handle; + nm_tc_tfilter_get_kind; + nm_tc_tfilter_get_parent; + nm_tc_tfilter_get_type; + nm_tc_tfilter_new; + nm_tc_tfilter_ref; + nm_tc_tfilter_set_handle; + nm_tc_tfilter_unref; + nm_team_link_watcher_arp_ping_flags_get_type; + nm_team_link_watcher_dup; + nm_team_link_watcher_equal; + nm_team_link_watcher_get_delay_down; + nm_team_link_watcher_get_delay_up; + nm_team_link_watcher_get_flags; + nm_team_link_watcher_get_init_wait; + nm_team_link_watcher_get_interval; + nm_team_link_watcher_get_missed_max; + nm_team_link_watcher_get_name; + nm_team_link_watcher_get_source_host; + nm_team_link_watcher_get_target_host; + nm_team_link_watcher_get_type; + nm_team_link_watcher_new_arp_ping; + nm_team_link_watcher_new_ethtool; + nm_team_link_watcher_new_nsna_ping; + nm_team_link_watcher_ref; + nm_team_link_watcher_unref; + nm_utils_tc_action_from_str; + nm_utils_tc_action_to_str; + nm_utils_tc_qdisc_from_str; + nm_utils_tc_qdisc_to_str; + nm_utils_tc_tfilter_from_str; + nm_utils_tc_tfilter_to_str; +} libnm_1_10_0; diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index e664b710..54a951a6 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -806,7 +806,7 @@ activate_info_complete (ActivateInfo *info, g_simple_async_result_set_from_error (info->simple, error); g_simple_async_result_complete (info->simple); - c_list_unlink (&info->lst); + c_list_unlink_stale (&info->lst); g_free (info->active_path); g_free (info->new_connection_path); diff --git a/libnm/nm-object.c b/libnm/nm-object.c index c344a08d..c5316880 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -161,7 +161,7 @@ typedef struct { static void notify_item_free (NotifyItem *item) { - c_list_unlink (&item->lst); + c_list_unlink_stale (&item->lst); g_clear_object (&item->changed); g_slice_free (NotifyItem, item); } @@ -187,7 +187,7 @@ deferred_notify_cb (gpointer data) * list we're iterating. */ c_list_link_after (&priv->notify_items, &props); - c_list_unlink_init (&priv->notify_items); + c_list_unlink (&priv->notify_items); g_object_ref (object); @@ -344,7 +344,7 @@ odata_free (gpointer data) { ObjectCreatedData *odata = data; - c_list_unlink (&odata->lst_pending); + c_list_unlink_stale (&odata->lst_pending); g_object_unref (odata->self); g_free (odata->objects); g_slice_free (ObjectCreatedData, odata); diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index 36f61c08..f05ba17b 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -320,13 +320,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c index 5cd42555..25fe3529 100644 --- a/libnm/nm-remote-connection.c +++ b/libnm/nm-remote-connection.c @@ -67,6 +67,111 @@ typedef struct { /*****************************************************************************/ +static void +update2_cb (GObject *proxy, GAsyncResult *result, gpointer user_data) +{ + GSimpleAsyncResult *simple = user_data; + GError *error = NULL; + GVariant *v; + + if (nmdbus_settings_connection_call_update2_finish (NMDBUS_SETTINGS_CONNECTION (proxy), + &v, + result, + &error)) + g_simple_async_result_set_op_res_gpointer (simple, + v, + (GDestroyNotify) g_variant_unref); + else { + g_dbus_error_strip_remote_error (error); + g_simple_async_result_take_error (simple, error); + } + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +/** + * nm_remote_connection_update2: + * @connection: the #NMRemoteConnection + * @settings: (allow-none): optional connection to update the settings. + * @flags: update-flags + * @args: (allow-none): optional arguments. + * @cancellable: a #GCancellable, or %NULL + * @callback: callback to be called when the commit operation completes + * @user_data: caller-specific data passed to @callback + * + * Asynchronously calls the Update2() D-Bus method. + * + * Since: 1.10.2 + **/ +void +nm_remote_connection_update2 (NMRemoteConnection *connection, + GVariant *settings, + NMSettingsUpdate2Flags flags, + GVariant *args, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + NMRemoteConnectionPrivate *priv; + GSimpleAsyncResult *simple; + GVariantBuilder builder; + + g_return_if_fail (NM_IS_REMOTE_CONNECTION (connection)); + g_return_if_fail (!settings || g_variant_is_of_type (settings, NM_VARIANT_TYPE_CONNECTION)); + g_return_if_fail (!args || g_variant_is_of_type (args, G_VARIANT_TYPE ("a{sv}"))); + g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable)); + + priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection); + + simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, + nm_remote_connection_update2); + + if (!settings) { + g_variant_builder_init (&builder, NM_VARIANT_TYPE_CONNECTION); + settings = g_variant_builder_end (&builder); + } + if (!args) { + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + args = g_variant_builder_end (&builder); + } + nmdbus_settings_connection_call_update2 (priv->proxy, + settings, + flags, + args, + cancellable, + update2_cb, + simple); +} + +/** + * nm_remote_connection_update2_finish: + * @connection: the #NMRemoteConnection + * @result: the result passed to the #GAsyncReadyCallback + * @error: location for a #GError, or %NULL + * + * Gets the result of a call to nm_remote_connection_commit_changes_async(). + * + * Returns: on success, a #GVariant of type "a{sv}" with the result. On failure, + * %NULL. + **/ +GVariant * +nm_remote_connection_update2_finish (NMRemoteConnection *connection, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), nm_remote_connection_update2), FALSE); + + simple = G_SIMPLE_ASYNC_RESULT (result); + if (g_simple_async_result_propagate_error (simple, error)) + return NULL; + else + return g_variant_ref (g_simple_async_result_get_op_res_gpointer (simple)); +} + +/*****************************************************************************/ + /** * nm_remote_connection_commit_changes: * @connection: the #NMRemoteConnection @@ -87,23 +192,25 @@ nm_remote_connection_commit_changes (NMRemoteConnection *connection, GError **error) { NMRemoteConnectionPrivate *priv; - GVariant *settings; + gs_unref_variant GVariant *result = NULL; gboolean ret; + GVariantBuilder args; g_return_val_if_fail (NM_IS_REMOTE_CONNECTION (connection), FALSE); priv = NM_REMOTE_CONNECTION_GET_PRIVATE (connection); - settings = nm_connection_to_dbus (NM_CONNECTION (connection), NM_CONNECTION_SERIALIZE_ALL); - if (save_to_disk) { - ret = nmdbus_settings_connection_call_update_sync (priv->proxy, - settings, - cancellable, error); - } else { - ret = nmdbus_settings_connection_call_update_unsaved_sync (priv->proxy, - settings, - cancellable, error); - } + g_variant_builder_init (&args, G_VARIANT_TYPE ("a{sv}")); + ret = nmdbus_settings_connection_call_update2_sync (priv->proxy, + nm_connection_to_dbus (NM_CONNECTION (connection), + NM_CONNECTION_SERIALIZE_ALL), + save_to_disk + ? NM_SETTINGS_UPDATE2_FLAG_TO_DISK + : NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY, + g_variant_builder_end (&args), + &result, + cancellable, + error); if (error && *error) g_dbus_error_strip_remote_error (*error); return ret; @@ -113,11 +220,13 @@ static void update_cb (GObject *proxy, GAsyncResult *result, gpointer user_data) { GSimpleAsyncResult *simple = user_data; - gboolean (*finish_func) (NMDBusSettingsConnection *, GAsyncResult *, GError **); GError *error = NULL; + gs_unref_variant GVariant *v = NULL; - finish_func = g_object_get_data (G_OBJECT (simple), "finish_func"); - if (finish_func (NMDBUS_SETTINGS_CONNECTION (proxy), result, &error)) + if (nmdbus_settings_connection_call_update2_finish (NMDBUS_SETTINGS_CONNECTION (proxy), + &v, + result, + &error)) g_simple_async_result_set_op_res_gboolean (simple, TRUE); else { g_dbus_error_strip_remote_error (error); @@ -149,7 +258,7 @@ nm_remote_connection_commit_changes_async (NMRemoteConnection *connection, { NMRemoteConnectionPrivate *priv; GSimpleAsyncResult *simple; - GVariant *settings; + GVariantBuilder args; g_return_if_fail (NM_IS_REMOTE_CONNECTION (connection)); @@ -158,22 +267,17 @@ nm_remote_connection_commit_changes_async (NMRemoteConnection *connection, simple = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, nm_remote_connection_commit_changes_async); - settings = nm_connection_to_dbus (NM_CONNECTION (connection), NM_CONNECTION_SERIALIZE_ALL); - if (save_to_disk) { - g_object_set_data (G_OBJECT (simple), "finish_func", - nmdbus_settings_connection_call_update_finish); - nmdbus_settings_connection_call_update (priv->proxy, - settings, - cancellable, - update_cb, simple); - } else { - g_object_set_data (G_OBJECT (simple), "finish_func", - nmdbus_settings_connection_call_update_unsaved_finish); - nmdbus_settings_connection_call_update_unsaved (priv->proxy, - settings, - cancellable, - update_cb, simple); - } + g_variant_builder_init (&args, G_VARIANT_TYPE ("a{sv}")); + nmdbus_settings_connection_call_update2 (priv->proxy, + nm_connection_to_dbus (NM_CONNECTION (connection), + NM_CONNECTION_SERIALIZE_ALL), + save_to_disk + ? NM_SETTINGS_UPDATE2_FLAG_TO_DISK + : NM_SETTINGS_UPDATE2_FLAG_IN_MEMORY, + g_variant_builder_end (&args), + cancellable, + update_cb, + simple); } /** @@ -202,6 +306,8 @@ nm_remote_connection_commit_changes_finish (NMRemoteConnection *connection, return g_simple_async_result_get_op_res_gboolean (simple); } +/*****************************************************************************/ + /** * nm_remote_connection_save: * @connection: the #NMRemoteConnection @@ -302,6 +408,8 @@ nm_remote_connection_save_finish (NMRemoteConnection *connection, return g_simple_async_result_get_op_res_gboolean (simple); } +/*****************************************************************************/ + /** * nm_remote_connection_delete: * @connection: the #NMRemoteConnection diff --git a/libnm/nm-remote-connection.h b/libnm/nm-remote-connection.h index c04ae367..9fdcae89 100644 --- a/libnm/nm-remote-connection.h +++ b/libnm/nm-remote-connection.h @@ -60,6 +60,19 @@ typedef struct { GType nm_remote_connection_get_type (void); +NM_AVAILABLE_IN_1_10_2 +void nm_remote_connection_update2 (NMRemoteConnection *connection, + GVariant *settings, + NMSettingsUpdate2Flags flags, + GVariant *args, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +NM_AVAILABLE_IN_1_10_2 +GVariant *nm_remote_connection_update2_finish (NMRemoteConnection *connection, + GAsyncResult *result, + GError **error); + gboolean nm_remote_connection_commit_changes (NMRemoteConnection *connection, gboolean save_to_disk, GCancellable *cancellable, diff --git a/libnm/nm-settings-docs-overrides.xml b/libnm/nm-settings-docs-overrides.xml index 3e4a57d0..f85b834c 100644 --- a/libnm/nm-settings-docs-overrides.xml +++ b/libnm/nm-settings-docs-overrides.xml @@ -132,6 +132,8 @@ also exist on some routes."/> + + diff --git a/libnm/nm-settings-docs.xml b/libnm/nm-settings-docs.xml index 09fde86d..8711ad27 100644 --- a/libnm/nm-settings-docs.xml +++ b/libnm/nm-settings-docs.xml @@ -326,14 +326,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libnm/nm-settings-ifcfg-rh-docs.xml b/libnm/nm-settings-ifcfg-rh-docs.xml index 7f3cf25d..4fa11864 100644 --- a/libnm/nm-settings-ifcfg-rh-docs.xml +++ b/libnm/nm-settings-ifcfg-rh-docs.xml @@ -58,9 +58,9 @@ lookaside file, or it can be owned by a secret agent."/> - +BRIDGE_MACADDR for bridges is an NM extension."/> @@ -174,6 +174,7 @@ meaning as 'never-default' property."/> + @@ -190,7 +191,7 @@ DHCP_FQDN are specified only the latter is used."/> ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yes"/> - + @@ -209,6 +210,7 @@ If set to -1, a default metric based on the device type is used."/> + @@ -241,6 +243,10 @@ proxy configuration, or set the PAC file via PAC_URL or PAC_SCRIPT."/> + + + + @@ -320,9 +326,10 @@ separated list."/> - +for WEP passphrases. KEY_TYPE specifies the key type and can be either +'key' or 'passphrase'. KEY_TYPE is redundant and can be omitted."/> diff --git a/libnm/nm-settings-keyfile-docs.xml b/libnm/nm-settings-keyfile-docs.xml index c7f68ab4..561b0588 100644 --- a/libnm/nm-settings-keyfile-docs.xml +++ b/libnm/nm-settings-keyfile-docs.xml @@ -74,6 +74,8 @@ route2=7.7.0.0/16" description="List of IP routes."/> versions of NetworkManager stored this as an integer: 69 ('E') for even, 111 ('o') for odd, or 110 ('n') for none."/> + + -- cgit 1.3.0-6-gf8a5