Revert "libnm: introduce the new get_ports() in bridge/bond API"

Let's instead add a generic nm_device_get_ports() function.
Also, only adding new API is maybe not sufficient. We should
at the same time deprecate and alias the D-Bus API, like was done
for commit 067a3d6c08 ('nm-device: expose via D-Bus the 'hw-address'
property').

This reverts commit 754143f4e8.
This commit is contained in:
Thomas Haller
2021-06-02 12:02:48 +02:00
parent 754143f4e8
commit 5d50e7d78d
5 changed files with 2 additions and 54 deletions

View File

@@ -1787,8 +1787,6 @@ global:
libnm_1_32_0 { libnm_1_32_0 {
global: global:
nm_device_bond_get_ports;
nm_device_bridge_get_ports;
nm_ethtool_optname_is_pause; nm_ethtool_optname_is_pause;
nm_setting_match_new; nm_setting_match_new;
nm_setting_wired_get_accept_all_mac_addresses; nm_setting_wired_get_accept_all_mac_addresses;

View File

@@ -83,29 +83,9 @@ nm_device_bond_get_carrier(NMDeviceBond *device)
* Returns: (element-type NMDevice): the #GPtrArray containing * Returns: (element-type NMDevice): the #GPtrArray containing
* #NMDevices that are slaves of @device. This is the internal * #NMDevices that are slaves of @device. This is the internal
* copy used by the device, and must not be modified. * copy used by the device, and must not be modified.
*
* Deprecated: 1.32: Use nm_device_bond_get_ports().
**/ **/
const GPtrArray * const GPtrArray *
nm_device_bond_get_slaves(NMDeviceBond *device) nm_device_bond_get_slaves(NMDeviceBond *device)
{
return nm_device_bond_get_ports(device);
}
/**
* nm_device_bond_get_ports:
* @device: a #NMDeviceBond
*
* Gets the devices currently set as port of @device.
*
* Returns: (element-type NMDevice): the #GPtrArray containing
* #NMDevices that are ports of @device. This is the internal
* copy used by the device, and must not be modified.
*
* Since: 1.32
**/
const GPtrArray *
nm_device_bond_get_ports(NMDeviceBond *device)
{ {
g_return_val_if_fail(NM_IS_DEVICE_BOND(device), FALSE); g_return_val_if_fail(NM_IS_DEVICE_BOND(device), FALSE);

View File

@@ -82,29 +82,9 @@ nm_device_bridge_get_carrier(NMDeviceBridge *device)
* Returns: (element-type NMDevice): the #GPtrArray containing * Returns: (element-type NMDevice): the #GPtrArray containing
* #NMDevices that are slaves of @device. This is the internal * #NMDevices that are slaves of @device. This is the internal
* copy used by the device, and must not be modified. * copy used by the device, and must not be modified.
*
* Deprecated: 1.32: Use nm_device_bridge_get_ports().
**/ **/
const GPtrArray * const GPtrArray *
nm_device_bridge_get_slaves(NMDeviceBridge *device) nm_device_bridge_get_slaves(NMDeviceBridge *device)
{
return nm_device_bridge_get_ports(device);
}
/**
* nm_device_bridge_get_ports:
* @device: a #NMDeviceBridge
*
* Gets the devices currently set as port of @device.
*
* Returns: (element-type NMDevice): the #GPtrArray containing
* #NMDevices that are ports of @device. This is the internal
* copy used by the device, and must not be modified.
*
* Since: 1.32
**/
const GPtrArray *
nm_device_bridge_get_ports(NMDeviceBridge *device)
{ {
g_return_val_if_fail(NM_IS_DEVICE_BRIDGE(device), FALSE); g_return_val_if_fail(NM_IS_DEVICE_BRIDGE(device), FALSE);

View File

@@ -37,12 +37,7 @@ GType nm_device_bond_get_type(void);
NM_DEPRECATED_IN_1_24_FOR(nm_device_get_hw_address) NM_DEPRECATED_IN_1_24_FOR(nm_device_get_hw_address)
const char *nm_device_bond_get_hw_address(NMDeviceBond *device); const char *nm_device_bond_get_hw_address(NMDeviceBond *device);
gboolean nm_device_bond_get_carrier(NMDeviceBond *device); gboolean nm_device_bond_get_carrier(NMDeviceBond *device);
NM_AVAILABLE_IN_1_32
const GPtrArray *nm_device_bond_get_ports(NMDeviceBond *device);
NM_DEPRECATED_IN_1_32_FOR(nm_device_get_ports)
const GPtrArray *nm_device_bond_get_slaves(NMDeviceBond *device); const GPtrArray *nm_device_bond_get_slaves(NMDeviceBond *device);
G_END_DECLS G_END_DECLS

View File

@@ -38,12 +38,7 @@ GType nm_device_bridge_get_type(void);
NM_DEPRECATED_IN_1_24_FOR(nm_device_get_hw_address) NM_DEPRECATED_IN_1_24_FOR(nm_device_get_hw_address)
const char *nm_device_bridge_get_hw_address(NMDeviceBridge *device); const char *nm_device_bridge_get_hw_address(NMDeviceBridge *device);
gboolean nm_device_bridge_get_carrier(NMDeviceBridge *device); gboolean nm_device_bridge_get_carrier(NMDeviceBridge *device);
NM_AVAILABLE_IN_1_32
const GPtrArray *nm_device_bridge_get_ports(NMDeviceBridge *device);
NM_DEPRECATED_IN_1_32_FOR(nm_device_bridge_get_ports)
const GPtrArray *nm_device_bridge_get_slaves(NMDeviceBridge *device); const GPtrArray *nm_device_bridge_get_slaves(NMDeviceBridge *device);
G_END_DECLS G_END_DECLS