Mon, Sep 07, 2015 at 06:00:31PM 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_per_port.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
index 0e62091..b85a425 100644
--- a/teamd/teamd_per_port.c
+++ b/teamd/teamd_per_port.c
@@ -340,6 +340,11 @@ 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 == -ENODEV) {
+ teamd_log_err("%s: Failed to add missing port.", port_name);
+ return 0;
+ }
+
This is not correct. In case user is adding port via ctl
(teamd_ctl_method_port_add), this would make it return success for
non-existent device.
What is your use-case? You device ports in config file?