about summary refs log tree commit diff
path: root/src/libnm-client-impl/nm-device-team.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-01-13 22:30:39 +0100
committerMichael Biebl <biebl@debian.org>2022-01-13 22:30:39 +0100
commit88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (patch)
tree71f32df6617802270e8a78574bd8e1637dc532f4 /src/libnm-client-impl/nm-device-team.c
parente74c568b07b50b97873fb4ee1d776dedefbd54d6 (diff)
New upstream version 1.34.0 upstream/1.34.0
Diffstat (limited to 'src/libnm-client-impl/nm-device-team.c')
-rw-r--r--src/libnm-client-impl/nm-device-team.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/libnm-client-impl/nm-device-team.c b/src/libnm-client-impl/nm-device-team.c
index ca29c9f7..9f7fe768 100644
--- a/src/libnm-client-impl/nm-device-team.c
+++ b/src/libnm-client-impl/nm-device-team.c
@@ -18,9 +18,8 @@
 NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_CARRIER, PROP_SLAVES, PROP_CONFIG, );
 
 typedef struct {
-    NMLDBusPropertyAO slaves;
-    char *            config;
-    bool              carrier;
+    char *config;
+    bool  carrier;
 } NMDeviceTeamPrivate;
 
 struct _NMDeviceTeam {
@@ -83,13 +82,13 @@ nm_device_team_get_carrier(NMDeviceTeam *device)
  * Returns: (element-type NMDevice): the #GPtrArray containing
  * #NMDevices that are slaves of @device. This is the internal
  * copy used by the device, and must not be modified.
+ *
+ * Deprecated: 1.34 Use nm_device_get_ports() instead.
  **/
 const GPtrArray *
 nm_device_team_get_slaves(NMDeviceTeam *device)
 {
-    g_return_val_if_fail(NM_IS_DEVICE_TEAM(device), FALSE);
-
-    return nml_dbus_property_ao_get_objs_as_ptrarray(&NM_DEVICE_TEAM_GET_PRIVATE(device)->slaves);
+    return nm_device_get_ports(NM_DEVICE(device));
 }
 
 /**
@@ -185,11 +184,10 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_team = NML_DBUS_META_IFACE
                                         0,
                                         "s",
                                         _nm_device_notify_update_prop_hw_address),
-        NML_DBUS_META_PROPERTY_INIT_AO_PROP("Slaves",
-                                            PROP_SLAVES,
-                                            NMDeviceTeam,
-                                            _priv.slaves,
-                                            nm_device_get_type), ), );
+        NML_DBUS_META_PROPERTY_INIT_FCN("Slaves",
+                                        PROP_SLAVES,
+                                        "ao",
+                                        _nm_device_notify_update_prop_ports), ), );
 
 static void
 nm_device_team_class_init(NMDeviceTeamClass *klass)
@@ -203,8 +201,6 @@ nm_device_team_class_init(NMDeviceTeamClass *klass)
 
     _NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT(nm_object_class, NMDeviceTeam);
 
-    _NM_OBJECT_CLASS_INIT_PROPERTY_AO_FIELDS_1(nm_object_class, NMDeviceTeamPrivate, slaves);
-
     device_class->connection_compatible = connection_compatible;
     device_class->get_setting_type      = get_setting_type;
 
@@ -244,4 +240,6 @@ nm_device_team_class_init(NMDeviceTeamClass *klass)
                                                       G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
 
     _nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_team);
+
+    device_class->slaves_param_spec = obj_properties[PROP_SLAVES];
 }