From 9e0551aefda92faede7c6a4b00711ce45810f3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Wed, 24 Sep 2025 11:30:59 +0200 Subject: [PATCH] core: document CleanupType We must do different cleanups depending on the CleanupType. Document the meaning of the different types as it was very confusing to work on new code without having very clear what do they mean. --- src/core/devices/nm-device.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 3cd8e78178..2c154b3256 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -113,6 +113,19 @@ typedef enum { RELEASE_PORT_TYPE_CONFIG_FORCE, } ReleasePortType; +/** + * CleanupType: + * @CLEANUP_TYPE_KEEP: Cleanup internally but keep the real device's config. This is + * often used when moving a partially managed device to "unmanaged" (but not only). + * @CLEANUP_TYPE_REMOVED: The device suddently disappeared. Cleanup internally but don't + * make any action on the real device at all, as it no longer exists. + * @CLEANUP_TYPE_DECONFIGURE: Also deconfigure the real device. This is the typical + * action when a connection or device is set to "down", or fully managed devices + * moved to "unmanaged". + * @CLEANUP_TYPE_KEEP_REAPPLY: Like %CLEANUP_TYPE_KEEP, but indicating that it's a + * reapply. Some special actions can be done if we're doing a reapply, like keeping + * the existing DHCP lease, for example. + */ typedef enum { CLEANUP_TYPE_KEEP, CLEANUP_TYPE_REMOVED,