mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 10:40:58 +01:00
devices: improve slave release log messages
Rather than putting "success %d" in the message, log different messages (at different priorities) for success and failure.
This commit is contained in:
parent
c48ba1ab10
commit
01b7bef6b4
4 changed files with 31 additions and 13 deletions
|
|
@ -447,10 +447,15 @@ release_slave (NMDevice *device, NMDevice *slave)
|
|||
success = nm_platform_link_release (nm_device_get_ip_ifindex (device),
|
||||
nm_device_get_ip_ifindex (slave));
|
||||
|
||||
nm_log_info (LOGD_BOND, "(%s): released bond slave %s (success %d)",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave),
|
||||
success);
|
||||
if (success) {
|
||||
nm_log_info (LOGD_BOND, "(%s): released bond slave %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
} else {
|
||||
nm_log_warn (LOGD_BOND, "(%s): failed to release bond slave %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
}
|
||||
g_object_notify (G_OBJECT (device), "slaves");
|
||||
|
||||
/* Kernel bonding code "closes" the slave when releasing it, (which clears
|
||||
|
|
|
|||
|
|
@ -404,10 +404,16 @@ release_slave (NMDevice *device, NMDevice *slave)
|
|||
success = nm_platform_link_release (nm_device_get_ip_ifindex (device),
|
||||
nm_device_get_ip_ifindex (slave));
|
||||
|
||||
nm_log_info (LOGD_BRIDGE, "(%s): detached bridge port %s (success %d)",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave),
|
||||
success);
|
||||
if (success) {
|
||||
nm_log_info (LOGD_BRIDGE, "(%s): detached bridge port %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
} else {
|
||||
nm_log_warn (LOGD_BRIDGE, "(%s): failed to detach bridge port %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (device), NM_DEVICE_BRIDGE_SLAVES);
|
||||
return success;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -717,10 +717,15 @@ release_slave (NMDevice *device, NMDevice *slave)
|
|||
success = nm_platform_link_release (nm_device_get_ip_ifindex (device),
|
||||
nm_device_get_ip_ifindex (slave));
|
||||
|
||||
nm_log_info (LOGD_TEAM, "(%s): released team port %s (success %d)",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave),
|
||||
success);
|
||||
if (success) {
|
||||
nm_log_info (LOGD_TEAM, "(%s): released team port %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
} else {
|
||||
nm_log_warn (LOGD_TEAM, "(%s): failed to release team port %s",
|
||||
nm_device_get_ip_iface (device),
|
||||
nm_device_get_ip_iface (slave));
|
||||
}
|
||||
g_object_notify (G_OBJECT (device), "slaves");
|
||||
|
||||
/* Kernel team code "closes" the port when releasing it, (which clears
|
||||
|
|
|
|||
|
|
@ -960,7 +960,9 @@ nm_device_release_one_slave (NMDevice *dev, NMDevice *slave)
|
|||
|
||||
if (info->enslaved) {
|
||||
success = NM_DEVICE_GET_CLASS (dev)->release_slave (dev, slave);
|
||||
g_warn_if_fail (success);
|
||||
/* The release_slave() implementation logs success/failure (in the
|
||||
* correct device-specific log domain), so we don't have to do anything.
|
||||
*/
|
||||
}
|
||||
|
||||
if (priv->state == NM_DEVICE_STATE_FAILED)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue