device: merge branch 'th/mlag-bonding-slb' (part 1)

Small spin-off from merge request with minor cleanups.
Merge early.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1385
This commit is contained in:
Thomas Haller 2022-09-29 14:29:35 +02:00
commit cd2f8945c9
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 25 additions and 23 deletions

View file

@ -6198,7 +6198,8 @@ nm_device_master_release_slave(NMDevice *self,
NMDevicePrivate *priv;
NMDevicePrivate *slave_priv;
SlaveInfo *info;
gs_unref_object NMDevice *self_free = NULL;
gs_unref_object NMDevice *self_free = NULL;
gs_unref_object NMDevice *slave_free = NULL;
g_return_if_fail(NM_DEVICE(self));
g_return_if_fail(NM_DEVICE(slave));
@ -6241,14 +6242,15 @@ nm_device_master_release_slave(NMDevice *self,
/* keep both alive until the end of the function.
* Transfers ownership from slave_priv->master. */
self_free = self;
nm_assert(self == slave_priv->master);
self_free = g_steal_pointer(&slave_priv->master);
nm_assert(slave == info->slave);
slave_free = g_steal_pointer(&info->slave);
c_list_unlink(&info->lst_slave);
slave_priv->master = NULL;
g_signal_handler_disconnect(slave, info->watch_id);
g_object_unref(slave);
g_slice_free(SlaveInfo, info);
nm_g_slice_free(info);
if (c_list_is_empty(&priv->slaves)) {
_active_connection_set_state_flags_full(self,
@ -16112,7 +16114,7 @@ nm_device_queue_state(NMDevice *self, NMDeviceState state, NMDeviceStateReason r
/* We should only ever have one delayed state transition at a time */
if (priv->queued_state.id) {
_LOGW(LOGD_DEVICE,
_LOGD(LOGD_DEVICE,
"queue-state[%s, reason:%s, id:%u]: %s",
nm_device_state_to_string(priv->queued_state.state),
nm_device_state_reason_to_string_a(priv->queued_state.reason),

View file

@ -116,22 +116,22 @@ static void auth_complete(NMActiveConnection *self, gboolean result, const char
#define _NMLOG_DOMAIN LOGD_DEVICE
#define _NMLOG_PREFIX_NAME "active-connection"
#define _NMLOG(level, ...) \
G_STMT_START \
{ \
char _sbuf[64]; \
NMActiveConnectionPrivate *_priv = self ? NM_ACTIVE_CONNECTION_GET_PRIVATE(self) : NULL; \
\
nm_log((level), \
_NMLOG_DOMAIN, \
(_priv && _priv->device) ? nm_device_get_iface(_priv->device) : NULL, \
(_priv && _priv->applied_connection) \
? nm_connection_get_uuid(_priv->applied_connection) \
: NULL, \
"%s%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
_NMLOG_PREFIX_NAME, \
self ? nm_sprintf_buf(_sbuf, "[%p]", self) : "" _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
} \
#define _NMLOG(level, ...) \
G_STMT_START \
{ \
char _sbuf[64]; \
NMActiveConnectionPrivate *_priv = self ? NM_ACTIVE_CONNECTION_GET_PRIVATE(self) : NULL; \
\
nm_log((level), \
_NMLOG_DOMAIN, \
(_priv && _priv->device) ? nm_device_get_iface(_priv->device) : NULL, \
(_priv && _priv->applied_connection) \
? nm_connection_get_uuid(_priv->applied_connection) \
: NULL, \
"%s%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
_NMLOG_PREFIX_NAME, \
NM_HASH_OBFUSCATE_PTR_STR(self, _sbuf) _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
} \
G_STMT_END
/*****************************************************************************/