Commit 569cca65 authored by Thomas Haller's avatar Thomas Haller

device: rename NM_UNMANAGED_USER_CONFIG to NM_UNMANAGED_USER_SETTINGS

The NM_UNMANAGED_USER_SETTINGS flags are determined by the settings plugins.
That is, either:
  - keyfile's "unmanaged-devices" configuration option
  - ifcfg-rh's "NM_CONTROLLED" option
  - ifnet's "managed" option

Rename NM_UNMANAGED_USER_CONFIG to NM_UNMANAGED_USER_SETTINGS to reflect
that it this is user configuration determined by the settings plugin.
parent d3e776b0
...@@ -8968,7 +8968,7 @@ NM_UTILS_FLAGS2STR_DEFINE (nm_unmanaged_flags2str, NMUnmanagedFlags, ...@@ -8968,7 +8968,7 @@ NM_UTILS_FLAGS2STR_DEFINE (nm_unmanaged_flags2str, NMUnmanagedFlags,
NM_UTILS_FLAGS2STR (NM_UNMANAGED_PLATFORM_INIT, "platform-init"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_PLATFORM_INIT, "platform-init"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_EXPLICIT, "user-explicit"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_EXPLICIT, "user-explicit"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_BY_DEFAULT, "by-default"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_BY_DEFAULT, "by-default"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_CONFIG, "user-config"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_SETTINGS, "user-settings"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_UDEV, "user-udev"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_USER_UDEV, "user-udev"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_EXTERNAL_DOWN, "external-down"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_EXTERNAL_DOWN, "external-down"),
NM_UTILS_FLAGS2STR (NM_UNMANAGED_IS_SLAVE, "is-slave"), NM_UTILS_FLAGS2STR (NM_UNMANAGED_IS_SLAVE, "is-slave"),
...@@ -9029,7 +9029,7 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo ...@@ -9029,7 +9029,7 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo
* Some flags are authoritative, meaning they always cause * Some flags are authoritative, meaning they always cause
* the device to be unmanaged (e.g. @NM_UNMANAGED_PLATFORM_INIT). * the device to be unmanaged (e.g. @NM_UNMANAGED_PLATFORM_INIT).
* *
* OTOH, some flags can be overwritten. For example NM_UNMANAGED_USER_CONFIG * OTOH, some flags can be overwritten. For example NM_UNMANAGED_USER_SETTINGS
* is ignored once NM_UNMANAGED_USER_EXPLICIT is set. The idea is that * is ignored once NM_UNMANAGED_USER_EXPLICIT is set. The idea is that
* the flag from the configuration has no effect once the user explicitly * the flag from the configuration has no effect once the user explicitly
* touches the unmanaged flags. */ * touches the unmanaged flags. */
...@@ -9051,26 +9051,26 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo ...@@ -9051,26 +9051,26 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo
flags &= ~NM_UNMANAGED_USER_EXPLICIT; flags &= ~NM_UNMANAGED_USER_EXPLICIT;
} }
if ( NM_FLAGS_ANY (mask, NM_UNMANAGED_USER_CONFIG) if ( NM_FLAGS_ANY (mask, NM_UNMANAGED_USER_SETTINGS)
&& !NM_FLAGS_ANY (flags, NM_UNMANAGED_USER_CONFIG)) { && !NM_FLAGS_ANY (flags, NM_UNMANAGED_USER_SETTINGS)) {
/* NM_UNMANAGED_USER_CONFIG can only explicitly unmanage a device. It cannot /* NM_UNMANAGED_USER_SETTINGS can only explicitly unmanage a device. It cannot
* *manage* it. Having NM_UNMANAGED_USER_CONFIG explicitly not set, is the * *manage* it. Having NM_UNMANAGED_USER_SETTINGS explicitly not set, is the
* same as having it not set at all. */ * same as having it not set at all. */
mask &= ~NM_UNMANAGED_USER_CONFIG; mask &= ~NM_UNMANAGED_USER_SETTINGS;
} }
if (NM_FLAGS_ANY (mask, NM_UNMANAGED_USER_UDEV | NM_UNMANAGED_USER_CONFIG)) { if (NM_FLAGS_ANY (mask, NM_UNMANAGED_USER_UDEV | NM_UNMANAGED_USER_SETTINGS)) {
/* configuration from udev or nm-config overwrites the by-default flag /* configuration from udev or nm-config overwrites the by-default flag
* which is based on the device type. */ * which is based on the device type. */
flags &= ~NM_UNMANAGED_BY_DEFAULT; flags &= ~NM_UNMANAGED_BY_DEFAULT;
} }
if (NM_FLAGS_HAS (mask, NM_UNMANAGED_USER_CONFIG)) { if (NM_FLAGS_HAS (mask, NM_UNMANAGED_USER_SETTINGS)) {
/* configuration from configuration overwrites the setting /* configuration from configuration overwrites the setting
* originating from udev. * originating from udev.
* *
* Actually, this check has no effect, because at this point, * Actually, this check has no effect, because at this point,
* the device also is NM_UNMANAGED_USER_CONFIG. Thus clearing * the device also is NM_UNMANAGED_USER_SETTINGS. Thus clearing
* NM_UNMANAGED_USER_UDEV doesn't change the outcome. * NM_UNMANAGED_USER_UDEV doesn't change the outcome.
* Just be explicit about this. */ * Just be explicit about this. */
flags &= ~NM_UNMANAGED_USER_UDEV; flags &= ~NM_UNMANAGED_USER_UDEV;
...@@ -9087,7 +9087,7 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo ...@@ -9087,7 +9087,7 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo
* are ignored. */ * are ignored. */
flags &= ~( NM_UNMANAGED_BY_DEFAULT flags &= ~( NM_UNMANAGED_BY_DEFAULT
| NM_UNMANAGED_USER_CONFIG | NM_UNMANAGED_USER_SETTINGS
| NM_UNMANAGED_USER_UDEV | NM_UNMANAGED_USER_UDEV
| NM_UNMANAGED_EXTERNAL_DOWN); | NM_UNMANAGED_EXTERNAL_DOWN);
} }
...@@ -9294,7 +9294,7 @@ nm_device_set_unmanaged_by_user_config (NMDevice *self, const GSList *unmanaged_ ...@@ -9294,7 +9294,7 @@ nm_device_set_unmanaged_by_user_config (NMDevice *self, const GSList *unmanaged_
unmanaged = nm_device_spec_match_list (self, unmanaged_specs); unmanaged = nm_device_spec_match_list (self, unmanaged_specs);
nm_device_set_unmanaged_by_flags (self, nm_device_set_unmanaged_by_flags (self,
NM_UNMANAGED_USER_CONFIG, NM_UNMANAGED_USER_SETTINGS,
unmanaged, unmanaged,
unmanaged unmanaged
? NM_DEVICE_STATE_REASON_NOW_UNMANAGED ? NM_DEVICE_STATE_REASON_NOW_UNMANAGED
......
...@@ -432,7 +432,9 @@ RfKillType nm_device_get_rfkill_type (NMDevice *device); ...@@ -432,7 +432,9 @@ RfKillType nm_device_get_rfkill_type (NMDevice *device);
* (e.g. via a D-Bus command) * (e.g. via a D-Bus command)
* @NM_UNMANAGED_BY_DEFAULT: %TRUE for certain device types where we unmanage * @NM_UNMANAGED_BY_DEFAULT: %TRUE for certain device types where we unmanage
* them by default * them by default
* @NM_UNMANAGED_USER_CONFIG: %TRUE when unmanaged by user decision (via unmanaged-specs) * @NM_UNMANAGED_USER_SETTINGS: %TRUE when unmanaged by user decision via
* the settings plugin (for example keyfile.unmanaged-devices or ifcfg-rh's
* NM_CONTROLLED=no)
* @NM_UNMANAGED_USER_UDEV: %TRUE when unmanaged by user decision (via UDev rule) * @NM_UNMANAGED_USER_UDEV: %TRUE when unmanaged by user decision (via UDev rule)
* @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM * @NM_UNMANAGED_EXTERNAL_DOWN: %TRUE when unmanaged because !IFF_UP and not created by NM
* @NM_UNMANAGED_IS_SLAVE: indicates that the device is enslaved. Note that * @NM_UNMANAGED_IS_SLAVE: indicates that the device is enslaved. Note that
...@@ -454,7 +456,7 @@ typedef enum { /*< skip >*/ ...@@ -454,7 +456,7 @@ typedef enum { /*< skip >*/
/* These flags can be non-effective and be overwritten /* These flags can be non-effective and be overwritten
* by other flags. */ * by other flags. */
NM_UNMANAGED_BY_DEFAULT = (1LL << 8), NM_UNMANAGED_BY_DEFAULT = (1LL << 8),
NM_UNMANAGED_USER_CONFIG = (1LL << 9), NM_UNMANAGED_USER_SETTINGS = (1LL << 9),
NM_UNMANAGED_USER_UDEV = (1LL << 10), NM_UNMANAGED_USER_UDEV = (1LL << 10),
NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 11), NM_UNMANAGED_EXTERNAL_DOWN = (1LL << 11),
NM_UNMANAGED_IS_SLAVE = (1LL << 12), NM_UNMANAGED_IS_SLAVE = (1LL << 12),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment