diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 8d9939b096..ae3d4ddb96 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -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 diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 92cc9f2a77..99aa0aff2c 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -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; } diff --git a/src/devices/nm-device-team.c b/src/devices/nm-device-team.c index a82b4c6bfc..ee0fa561bd 100644 --- a/src/devices/nm-device-team.c +++ b/src/devices/nm-device-team.c @@ -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 diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 1f5fb718d3..d326d2f8e6 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -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)