mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 03:10:10 +01:00
The ifcfg-rh plugin provides its own D-Bus service which initscripts query to determine whether NetworkManager handles an ifcfg file. Rework the D-Bus glue to hook GDBus with NetworkManager to use GDBusConnection directly. Don't use generated code, don't use GDBusInterfaceSkeleton. We still keep "src/settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml" and still compile the static generated code. We don't actually need them anymore, maybe the should be dropped later. This is a proof of concept for reworking the D-Bus glue in NetworkManager core to directly use GDBusConnection. Reworking core is much more complicated, because there we also have properties, and a class hierarchy. Arguably, for the trivial ifcfg-rh service all this hardly matters, because the entire D-Bus service only consists of one method, which is unlikely to be extended in the future. Now we get rid of layers of glue code, that were hard to comprehend. Did you understand how nm_exported_object_skeleton_create() works and uses the generated code and GDBusInterfaceSkeleton to hook into GDBusConnection? Congratulations in that case. In my opinion, these layers of code don't simplify but complicate the code. The change also reduces the binary size of "libnm-settings-plugin-ifcfg-rh.so" (build with contrib/rpm --without debug) by 8312 bytes (243672 vs. 235360). |
||
|---|---|---|
| .. | ||
| plugins | ||
| nm-agent-manager.c | ||
| nm-agent-manager.h | ||
| nm-secret-agent.c | ||
| nm-secret-agent.h | ||
| nm-settings-connection.c | ||
| nm-settings-connection.h | ||
| nm-settings-plugin.c | ||
| nm-settings-plugin.h | ||
| nm-settings.c | ||
| nm-settings.h | ||