core: rename internal function nm_policy_device_recheck_auto_activate_all_schedule()

The "all" variant is strongly related to nm_policy_device_recheck_auto_activate_schedule().
Rename, so that the names express that better.

(cherry picked from commit 886786ee0b)
This commit is contained in:
Thomas Haller 2023-04-05 11:02:36 +02:00
parent 073d3a619f
commit a446ee2e1b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -72,7 +72,8 @@ typedef struct {
guint reset_retries_id; /* idle handler for resetting the retries count */
guint schedule_activate_all_id; /* idle handler for schedule_activate_all(). */
guint
schedule_activate_all_id; /* idle handler for nm_policy_device_recheck_auto_activate_all_schedule(). */
NMPolicyHostnameMode hostname_mode;
char *orig_hostname; /* hostname at NM start time */
@ -135,7 +136,7 @@ _PRIV_TO_SELF(NMPolicyPrivate *priv)
/*****************************************************************************/
static void update_system_hostname(NMPolicy *self, const char *msg);
static void schedule_activate_all(NMPolicy *self);
static void nm_policy_device_recheck_auto_activate_all_schedule(NMPolicy *self);
static NMDevice *get_default_device(NMPolicy *self, int addr_family);
/*****************************************************************************/
@ -1760,7 +1761,7 @@ reset_connections_retries(gpointer user_data)
/* If anything changed, try to activate the newly re-enabled connections */
if (changed)
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
return FALSE;
}
@ -1858,7 +1859,7 @@ activate_slave_connections(NMPolicy *self, NMDevice *device)
}
if (changed)
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
}
static gboolean
@ -2513,7 +2514,7 @@ active_connection_removed(NMManager *manager, NMActiveConnection *active, gpoint
/*****************************************************************************/
static gboolean
schedule_activate_all_cb(gpointer user_data)
_device_recheck_auto_activate_all_cb(gpointer user_data)
{
NMPolicy *self = user_data;
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE(self);
@ -2529,23 +2530,25 @@ schedule_activate_all_cb(gpointer user_data)
}
static void
schedule_activate_all(NMPolicy *self)
nm_policy_device_recheck_auto_activate_all_schedule(NMPolicy *self)
{
NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE(self);
/* always restart the idle handler. That way, we settle
* all other events before restarting to activate them. */
nm_clear_g_source(&priv->schedule_activate_all_id);
priv->schedule_activate_all_id = g_idle_add(schedule_activate_all_cb, self);
priv->schedule_activate_all_id = g_idle_add(_device_recheck_auto_activate_all_cb, self);
}
/*****************************************************************************/
static void
connection_added(NMSettings *settings, NMSettingsConnection *connection, gpointer user_data)
{
NMPolicyPrivate *priv = user_data;
NMPolicy *self = _PRIV_TO_SELF(priv);
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
}
static void
@ -2613,7 +2616,7 @@ connection_updated(NMSettings *settings,
}
}
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
}
static void
@ -2662,7 +2665,7 @@ connection_flags_changed(NMSettings *settings, NMSettingsConnection *connection,
if (NM_FLAGS_HAS(nm_settings_connection_get_flags(connection),
NM_SETTINGS_CONNECTION_INT_FLAGS_VISIBLE)) {
if (!nm_settings_connection_autoconnect_is_blocked(connection))
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
}
}
@ -2676,7 +2679,7 @@ secret_agent_registered(NMSettings *settings, NMSecretAgent *agent, gpointer use
* connections failed due to missing secrets may re-try auto-connection.
*/
if (reset_autoconnect_all(self, NULL, TRUE))
schedule_activate_all(self);
nm_policy_device_recheck_auto_activate_all_schedule(self);
}
NMActiveConnection *