summaryrefslogtreecommitdiff
path: root/libnm-core/nm-team-utils.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-09-22 10:57:57 +0200
committerThomas Haller <thaller@redhat.com>2019-09-30 08:23:19 +0200
commitd534b6d07a235199af3044a6f156d2965dc0ddc0 (patch)
treeb7cfed943edf5ca589606e6489224e3a6c7726f6 /libnm-core/nm-team-utils.c
parent3f36f6915629d9a98f52fb266f82274785bb49c6 (diff)
downloadNetworkManager-d534b6d07a235199af3044a6f156d2965dc0ddc0.tar.gz
libnm: deduplicate NMSettInfoPropertType instances
There is no need to keep duplicate instances. Before we had 89 distinct property types, now there are 49.
Diffstat (limited to 'libnm-core/nm-team-utils.c')
-rw-r--r--libnm-core/nm-team-utils.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/libnm-core/nm-team-utils.c b/libnm-core/nm-team-utils.c
index 78c9182609..0be33b0383 100644
--- a/libnm-core/nm-team-utils.c
+++ b/libnm-core/nm-team-utils.c
@@ -2420,7 +2420,7 @@ _nm_setting_get_team_setting (struct _NMSetting *setting)
return _nm_setting_team_port_get_team_setting (NM_SETTING_TEAM_PORT (setting));
}
-GVariant *
+static GVariant *
_nm_team_settings_property_to_dbus (const NMSettInfoSetting *sett_info,
guint property_idx,
NMConnection *connection,
@@ -2467,7 +2467,7 @@ _nm_team_settings_property_to_dbus (const NMSettInfoSetting *sett_info,
return NULL;
}
-void
+static void
_nm_team_settings_property_from_dbus_link_watchers (GVariant *dbus_value,
GValue *prop_value)
{
@@ -2475,6 +2475,32 @@ _nm_team_settings_property_from_dbus_link_watchers (GVariant *dbus_value,
_nm_utils_team_link_watchers_from_variant (dbus_value, FALSE, NULL));
}
+const NMSettInfoPropertType nm_sett_info_propert_type_team_b = {
+ .dbus_type = G_VARIANT_TYPE_BOOLEAN,
+ .to_dbus_fcn = _nm_team_settings_property_to_dbus,
+};
+
+const NMSettInfoPropertType nm_sett_info_propert_type_team_i = {
+ .dbus_type = G_VARIANT_TYPE_INT32,
+ .to_dbus_fcn = _nm_team_settings_property_to_dbus,
+};
+
+const NMSettInfoPropertType nm_sett_info_propert_type_team_s = {
+ .dbus_type = G_VARIANT_TYPE_STRING,
+ .to_dbus_fcn = _nm_team_settings_property_to_dbus,
+};
+
+const NMSettInfoPropertType nm_sett_info_propert_type_team_as = {
+ .dbus_type = NM_G_VARIANT_TYPE ("as"),
+ .to_dbus_fcn = _nm_team_settings_property_to_dbus,
+};
+
+const NMSettInfoPropertType nm_sett_info_propert_type_team_link_watchers = {
+ .dbus_type = NM_G_VARIANT_TYPE ("aa{sv}"),
+ .to_dbus_fcn = _nm_team_settings_property_to_dbus,
+ .gprop_from_dbus_fcn = _nm_team_settings_property_from_dbus_link_watchers,
+};
+
/*****************************************************************************/
NMTeamSetting *