mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-22 01:58:10 +02:00
The state-change of a device has a reason argument, which is mostly for information only. There are many places in code that are the source of a state-reason. Mostly these are calls to: - nm_device_state_changed() - nm_device_queue_state() - nm_device_queue_recheck_available() - nm_device_set_unmanaged_by_*() - nm_device_master_release_one_slave() - nm_device_ip_method_failed() - nm_modem_emit_prepare_result() - nm_modem_emit_ppp_failed() - nm_manager_deactivate_connection() - NM_SET_OUT (out_failure_reason, NM_DEVICE_STATE_REASON_*); However, there are a few places in code that look at the reason to decide how to proceed. I think this is a bad pattern, because cause and effect are decoupled and it gets hard to understand where a certain reason is set and what consequences that has. Add a nop-function nm_device_state_reason_check() to mark all uses of the device state reason that derive decisions from it. That is, highlight the "effect" part. |
||
|---|---|---|
| .. | ||
| libnm-wwan.ver | ||
| nm-device-modem.c | ||
| nm-device-modem.h | ||
| nm-modem-broadband.c | ||
| nm-modem-broadband.h | ||
| nm-modem-manager.c | ||
| nm-modem-manager.h | ||
| nm-modem-ofono.c | ||
| nm-modem-ofono.h | ||
| nm-modem.c | ||
| nm-modem.h | ||
| nm-wwan-factory.c | ||