From 3fb13c63c3f77170a5301f0613ad37df482f9f4c Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 12 Feb 2014 10:40:24 -0500 Subject: [PATCH] core: don't block startup on assumed connections If we are assuming a connection at startup, the NMManager:startup state doesn't need to wait for that activation to complete, since the underlying device isn't going to change its configuration as a result of it. (In particular, NM considers virbr0 to be stalled at NM_DEVICE_STATE_IP_CONFIG when it assumes it, since if it has no real slaves, it won't yet have carrier. But this shouldn't block startup.) --- src/nm-active-connection.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index f7e275a4cf..e6fe7cd01b 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -401,8 +401,10 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device) g_signal_connect (device, "notify::master", G_CALLBACK (device_master_changed), self); - priv->pending_activation_id = g_strdup_printf ("activation::%p", (void *)self); - nm_device_add_pending_action (device, priv->pending_activation_id); + if (!priv->assumed) { + priv->pending_activation_id = g_strdup_printf ("activation::%p", (void *)self); + nm_device_add_pending_action (device, priv->pending_activation_id); + } } return TRUE; } @@ -540,6 +542,11 @@ nm_active_connection_set_assumed (NMActiveConnection *self, gboolean assumed) g_return_if_fail (priv->assumed == FALSE); priv->assumed = assumed; + + if (priv->pending_activation_id) { + nm_device_remove_pending_action (priv->device, priv->pending_activation_id); + g_clear_pointer (&priv->pending_activation_id, g_free); + } } gboolean