summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-02-28 13:55:40 +0100
committerThomas Haller <thaller@redhat.com>2020-03-17 08:13:22 +0100
commit99cb791813e416c62010a629939b36a4fc31548d (patch)
tree72774cf891572c37c3e0f111e91b9e3494f14b51
parent3d78740398a8238ee4ba4f02ca14a8812d0d5493 (diff)
downloadNetworkManager-99cb791813e416c62010a629939b36a4fc31548d.tar.gz
device: allow scheduling nm_device_activate_schedule_stage2_device_config() right away
We usually want to schedule stage2 when we just completed with the previous stage (or, if we are currently in stage2, and want to re-enter it). In those cases, the conditions are often right to just proceed right away. No need to schedule the stage on an idle handler. Allow to invoke stage2 right away.
-rw-r--r--src/devices/nm-device-private.h3
-rw-r--r--src/devices/nm-device.c20
2 files changed, 11 insertions, 12 deletions
diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h
index dc8a33f98e..8d539026e7 100644
--- a/src/devices/nm-device-private.h
+++ b/src/devices/nm-device-private.h
@@ -73,7 +73,8 @@ void nm_device_set_firmware_missing (NMDevice *self, gboolean missing);
void nm_device_activate_schedule_stage1_device_prepare (NMDevice *device,
gboolean do_sync);
-void nm_device_activate_schedule_stage2_device_config (NMDevice *device);
+void nm_device_activate_schedule_stage2_device_config (NMDevice *device,
+ gboolean do_sync);
void nm_device_activate_schedule_ip_config_result (NMDevice *device,
int addr_family,
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index e712d5813b..63cffc6235 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -691,8 +691,6 @@ static void (*const activate_stage4_ip_config_timeout_x[2]) (NMDevice *self) = {
static void sriov_op_cb (GError *error, gpointer user_data);
-static void activate_stage2_device_config (NMDevice *self);
-
static void activate_stage5_ip_config_result_4 (NMDevice *self);
static void activate_stage5_ip_config_result_6 (NMDevice *self);
@@ -6726,7 +6724,7 @@ activate_stage1_device_prepare (NMDevice *self)
if (master)
master_ready (self, active);
- activation_source_invoke_sync (self, activate_stage2_device_config, AF_INET);
+ nm_device_activate_schedule_stage2_device_config (self, TRUE);
}
void
@@ -7105,18 +7103,18 @@ activate_stage2_device_config (NMDevice *self)
nm_device_activate_schedule_stage3_ip_config_start (self);
}
-/*
- * nm_device_activate_schedule_stage2_device_config
- *
- * Schedule setup of the hardware device
- *
- */
void
-nm_device_activate_schedule_stage2_device_config (NMDevice *self)
+nm_device_activate_schedule_stage2_device_config (NMDevice *self,
+ gboolean do_sync)
{
g_return_if_fail (NM_IS_DEVICE (self));
- activation_source_schedule (self, activate_stage2_device_config, AF_INET);
+ if (!do_sync) {
+ activation_source_schedule (self, activate_stage2_device_config, AF_INET);
+ return;
+ }
+
+ activation_source_invoke_sync (self, activate_stage2_device_config, AF_INET);
}
void