Wed, Sep 09, 2015 at 11:11:19AM CEST, pwieczorkiewicz(a)suse.de wrote:
When multiple ports are specified in the config and one of
them is not present (e.g. usb2eth device) during team instance
start up time, instead of failing the whole setup, just report
failure with a missing port and carry on with the rest.
applied.
Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz(a)suse.de>
---
teamd/teamd.c | 9 ++++++++-
teamd/teamd_ctl.c | 5 +++++
teamd/teamd_per_port.c | 6 +-----
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index a7c0f77..0cb5e7e 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -846,8 +846,15 @@ static int teamd_add_ports(struct teamd_context *ctx)
teamd_config_for_each_key(key, ctx, "$.ports") {
err = teamd_port_add_ifname(ctx, key);
- if (err)
+ if (err == -ENODEV) {
+ teamd_log_warn("%s: Skipped adding a missing port.", key);
+ continue;
+ }
+ else if (err) {
I fixed this by hand, putting "}" and "else if (err) {" on a single
line.