mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 07:10:12 +01:00
Various synchronous methods (D-Bus calls) in libnm's NMClient API were
deprecated. The problem is that NMClient contains a cache of D-Bus
objects, and it gets updated by asynchronous events (D-Bus signals).
Those events get only processed when iterating the GMainContext, but
they are ordered.
When we perform a pseudo blocking D-Bus call with
g_dbus_connection_call_sync(), then GDBus creates a temporary
GMainContext, sends the request and iterates the internal context
blocking for the response. That is, this reply is not synchrounized with
the events that update the NMClient cache.
That is a problem for methods like nm_remote_connection_delete(),
because you call blocking delete, but afterwards the object is still in
the NMClient cache. That's why most blocking methods are deprecated.
While such blocking calls are therefore problematic, they can still be
very convenient to call from a simple script, a test tool or the python
REPL. See "examples/python/gi/nm-wg-set" which calls
nm_remote_connection_get_secrets(), and it would be (unnecessarily)
cumbersome to do the correct thing or using async API.
In particular, nm_remote_connection_get_secrets() doesn't retrieve an object
that is in the NMClient cache in the first place. Sure, the result is
out of order with the cache, but it's not obviously related and in most
cases it wouldn't matter to the user. So undeprecate this function again.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1345
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| meson.build | ||
| NetworkManager.h | ||
| nm-access-point.h | ||
| nm-active-connection.h | ||
| nm-autoptr.h | ||
| nm-checkpoint.h | ||
| nm-client.h | ||
| nm-conn-utils.h | ||
| nm-device-6lowpan.h | ||
| nm-device-adsl.h | ||
| nm-device-bond.h | ||
| nm-device-bridge.h | ||
| nm-device-bt.h | ||
| nm-device-dummy.h | ||
| nm-device-ethernet.h | ||
| nm-device-generic.h | ||
| nm-device-infiniband.h | ||
| nm-device-ip-tunnel.h | ||
| nm-device-macsec.h | ||
| nm-device-macvlan.h | ||
| nm-device-modem.h | ||
| nm-device-olpc-mesh.h | ||
| nm-device-ovs-bridge.h | ||
| nm-device-ovs-interface.h | ||
| nm-device-ovs-port.h | ||
| nm-device-ppp.h | ||
| nm-device-team.h | ||
| nm-device-tun.h | ||
| nm-device-veth.h | ||
| nm-device-vlan.h | ||
| nm-device-vrf.h | ||
| nm-device-vxlan.h | ||
| nm-device-wifi-p2p.h | ||
| nm-device-wifi.h | ||
| nm-device-wimax.h | ||
| nm-device-wireguard.h | ||
| nm-device-wpan.h | ||
| nm-device.h | ||
| nm-dhcp-config.h | ||
| nm-enum-types.c.template | ||
| nm-enum-types.h.template | ||
| nm-ethtool-utils.h | ||
| nm-ip-config.h | ||
| nm-object.h | ||
| nm-remote-connection.h | ||
| nm-secret-agent-old.h | ||
| nm-vpn-connection.h | ||
| nm-vpn-editor.h | ||
| nm-vpn-plugin-old.h | ||
| nm-vpn-service-plugin.h | ||
| nm-wifi-p2p-peer.h | ||
| nm-wimax-nsp.h | ||
| README.md | ||
libnm-client-public
libnm is NetworkManager's client API. It has a public API. This API consists of two parts:
- the handling of connections (
NMConnection), implemented by libnm-core-impl. - the caching of D-Bus API (
NMClient), implemented by libnm-client-impl.
This directory contains public headers that are used by libnm
users. As such, it's the NMClient part of libnm-core-public.
These headers are usable to any libnm client application and to libnm itself. But not to libnm-core-impl or the daemon.