Tue, Sep 08, 2015 at 12:09:28PM 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.
Signed-off-by: Pawel Wieczorkiewicz <pwieczorkiewicz(a)suse.de>
---
teamd/teamd.c | 2 ++
teamd/teamd_per_port.c | 4 +++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/teamd/teamd.c b/teamd/teamd.c
index a7c0f77..8102c79 100644
--- a/teamd/teamd.c
+++ b/teamd/teamd.c
@@ -846,6 +846,8 @@ 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 == -ENODEV)
+ continue;
if (err)
return err;
}
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
index 0e62091..9fc3b14 100644
--- a/teamd/teamd_per_port.c
+++ b/teamd/teamd_per_port.c
@@ -340,7 +340,9 @@ int teamd_port_add_ifname(struct teamd_context *ctx, const char
*port_name)
teamd_log_dbg("%s: Adding port (found ifindex \"%d\").",
port_name, ifindex);
err = team_port_add(ctx->th, ifindex);
- if (err)
+ if (err == -ENODEV)
+ teamd_log_warn("%s: Failed to add missing port.", port_name);
+ else if (err)
teamd_log_err("%s: Failed to add port.", port_name);
Does not look correct. We need to log err in case this is called from
ctl. So I guess we should move the log messages to callers of
teamd_port_add_ifname?
return err;
}
--
2.1.4
_______________________________________________
libteam mailing list
libteam(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/libteam