mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-12 07:40:31 +01:00
libnm: merge branch 'th/libnm-dangling-property-2'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1075
This commit is contained in:
commit
81cf70b0c1
2 changed files with 16 additions and 2 deletions
|
|
@ -1335,6 +1335,8 @@ nml_dbus_object_obj_changed_link(NMClient *self,
|
|||
nm_assert(NML_IS_DBUS_OBJECT(dbobj));
|
||||
nm_assert(changed_type != NML_DBUS_OBJ_CHANGED_TYPE_NONE);
|
||||
|
||||
/* Links @dbobj in the "obj_changed_lst", with the new "changed_type". */
|
||||
|
||||
if (!NM_FLAGS_ALL((NMLDBusObjChangedType) dbobj->obj_changed_type, changed_type))
|
||||
NML_NMCLIENT_LOG_T(self,
|
||||
"[%s]: changed-type 0x%02x linked",
|
||||
|
|
@ -1372,6 +1374,12 @@ nml_dbus_object_obj_changed_consume(NMClient *self,
|
|||
NMClientPrivate *priv;
|
||||
NMLDBusObjChangedType changed_type_res;
|
||||
|
||||
/* We have @dbobj which has some "obj_changed_type" set (consequently,
|
||||
* it's linked in the "obj_changed_lst"). Here we consume the @changed_type,
|
||||
* meaning, to clear those flags from "obj_change_type" (and return
|
||||
* the flags that were cleared/present or NONE, if the current object
|
||||
* doesn't have these changed-types. */
|
||||
|
||||
nm_assert(NM_IS_CLIENT(self));
|
||||
nm_assert(NML_IS_DBUS_OBJECT(dbobj));
|
||||
nm_assert(changed_type != NML_DBUS_OBJ_CHANGED_TYPE_NONE);
|
||||
|
|
@ -1383,6 +1391,8 @@ nml_dbus_object_obj_changed_consume(NMClient *self,
|
|||
dbobj->obj_changed_type &= ~changed_type;
|
||||
|
||||
if (dbobj->obj_changed_type == NML_DBUS_OBJ_CHANGED_TYPE_NONE) {
|
||||
/* No other "obj_change_type" left. Unlink the object from the
|
||||
* "changed_type_list". */
|
||||
c_list_unlink(&dbobj->obj_changed_lst);
|
||||
nm_assert(changed_type_res != NML_DBUS_OBJ_CHANGED_TYPE_NONE);
|
||||
NML_NMCLIENT_LOG_T(self,
|
||||
|
|
@ -1394,6 +1404,9 @@ nml_dbus_object_obj_changed_consume(NMClient *self,
|
|||
|
||||
priv = NM_CLIENT_GET_PRIVATE(self);
|
||||
|
||||
/* Actually, at this point, @dbobj is not linked in priv->obj_changed_lst_head,
|
||||
* instead, it's linked on a temporary list. As we still have changes left after
|
||||
* consuming "changed_type", we move it to priv->obj_changed_lst_head. */
|
||||
nm_assert(!c_list_contains(&priv->obj_changed_lst_head, &dbobj->obj_changed_lst));
|
||||
nm_c_list_move_tail(&priv->obj_changed_lst_head, &dbobj->obj_changed_lst);
|
||||
NML_NMCLIENT_LOG_T(self,
|
||||
|
|
@ -1837,6 +1850,7 @@ nml_dbus_property_o_clear(NMLDBusPropertyO *pr_o, NMClient *self)
|
|||
pr_o->meta_iface = NULL;
|
||||
pr_o->dbus_property_idx = 0;
|
||||
pr_o->is_ready = FALSE;
|
||||
pr_o->nmobj = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -812,7 +812,7 @@ _dev_eth0_1_state_changed_cb(NMDevice *device,
|
|||
g_assert(arr);
|
||||
g_assert_cmpint(arr->len, ==, 0);
|
||||
|
||||
// g_assert(!nm_device_get_active_connection(device));
|
||||
g_assert(!nm_device_get_active_connection(device));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -921,7 +921,7 @@ test_activate_virtual(void)
|
|||
g_assert(arr);
|
||||
g_assert_cmpint(arr->len, ==, 0);
|
||||
|
||||
// g_assert(!nm_device_get_active_connection(dev_eth0_1));
|
||||
g_assert(!nm_device_get_active_connection(dev_eth0_1));
|
||||
|
||||
nm_clear_g_signal_handler(dev_eth0_1, &sig_id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue