summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-09-13 18:38:59 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-09-20 07:54:13 +0200
commit74845f80ec8213a431a3112afe23b05661cddb79 (patch)
tree1fb738ad535cb080a7174a451808bdf0292bece5
parent03e1cc96a5dc3d9a9b86f60810a330332c484a94 (diff)
downloadNetworkManager-74845f80ec8213a431a3112afe23b05661cddb79.tar.gz
manager: try other connections only after the device is realized
After a device is created in system_create_virtual_device(), the manager tries to activate connections that depend on the device even if the device isn't realized, as in the following log: # team0 gets created <info> manager: (team0): new Team device (/org/freedesktop/NetworkManager/Devices/7) # team0.23 gets created <debug> device[0x28079b0] (team0.23): constructed (NMDeviceVlan) <debug> manager: (team0-vlan23) create virtual device team0.23 <debug> device[0x28079b0] (team0.23): unmanaged: flags set to [platform-init,!sleeping=0x10/0x11/unmanaged/unrealized], set-managed [sleeping <info> manager: (team0.23): new VLAN device (/org/freedesktop/NetworkManager/Devices/8) # the manager tries to realize team0.23 <debug> device[0x28079b0] (team0.23): create (is nm-owned) <warn> manager: (team0-vlan23) couldn't create the device: cannot retrieve ifindex of interface team0 (Team): skip VLAN creation for now <debug> manager: (team0.23): removing device (allow_unmanage 1, managed 0) <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=0, new-config=(nil)) <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=0, new-config=(nil)) <debug> device[0x28079b0] (team0.23): disposing <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=1, new-config=(nil)) <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=1, new-config=(nil)) <debug> device[0x28079b0] (team0.23): finalize(): NMDeviceVlan # the manager realizes team0 <debug> device[0x2800870] (team0): create (is nm-owned) <debug> platform: link: add link 'team0' of type 'team' (196610) Change the order of operations and try the child connection only after the parent has been realized.
-rw-r--r--src/nm-manager.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 263c2a0b0f..12f2ef0552 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -94,6 +94,8 @@ static void settings_startup_complete_changed (NMSettings *settings,
GParamSpec *pspec,
NMManager *self);
+static void retry_connections_for_parent_device (NMManager *self, NMDevice *device);
+
static NM_CACHED_QUARK_FCN ("active-connection-add-and-activate", active_connection_add_and_activate_quark)
typedef struct {
@@ -1385,6 +1387,8 @@ system_create_virtual_device (NMManager *self, NMConnection *connection)
remove_device (self, device, FALSE, TRUE);
return NULL;
}
+
+ retry_connections_for_parent_device (self, device);
break;
}
@@ -2232,11 +2236,6 @@ add_device (NMManager *self, NMDevice *device, GError **error)
_parent_notify_changed (self, device, FALSE);
- /* Virtual connections may refer to the new device as
- * parent device, retry to activate them.
- */
- retry_connections_for_parent_device (self, device);
-
return TRUE;
}
@@ -2262,6 +2261,7 @@ factory_device_added_cb (NMDeviceFactory *factory,
&error)) {
add_device (self, device, NULL);
_device_realize_finish (self, device, NULL);
+ retry_connections_for_parent_device (self, device);
} else {
_LOG2W (LOGD_DEVICE, device, "failed to realize device: %s", error->message);
g_error_free (error);
@@ -2415,6 +2415,7 @@ platform_link_added (NMManager *self,
&error)) {
add_device (self, device, NULL);
_device_realize_finish (self, device, plink);
+ retry_connections_for_parent_device (self, device);
} else {
_LOGW (LOGD_DEVICE, "%s: failed to realize device: %s",
plink->name, error->message);