libteam/0011-utils-team2bond-suppor...

40 lines
1.8 KiB
Diff

From 6bf7990d35900c033df03cd76c25b7986deb833f Mon Sep 17 00:00:00 2001
From: Hangbin Liu <haliu@redhat.com>
Date: Fri, 24 Mar 2023 10:59:21 +0800
Subject: [PATCH 11/15] utils/team2bond: support missed_max
Signed-off-by: Hangbin Liu <haliu@redhat.com>
---
utils/team2bond | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/utils/team2bond b/utils/team2bond
index 7fc4a48..e6e4f0d 100755
--- a/utils/team2bond
+++ b/utils/team2bond
@@ -153,6 +153,12 @@ def convert_link_watch(link_watch_opts, arp_target, exist_opts):
if 'target_host' in link_watch_opts:
arp_target.append(link_watch_opts['target_host'])
+ if 'missed_max' in link_watch_opts:
+ if exist_opts.find('arp_missed_max') >= 0:
+ print("# Warn: duplicated arp_missed_max detected, bonding supports only one.")
+ else:
+ bond_opts += ",arp_missed_max=" + str(link_watch_opts['missed_max'])
+
if 'validate_active' in link_watch_opts and link_watch_opts['validate_active'] and \
'validate_inactive' in link_watch_opts and link_watch_opts['validate_inactive']:
if exist_opts.find('arp_validate') >= 0:
@@ -172,8 +178,6 @@ def convert_link_watch(link_watch_opts, arp_target, exist_opts):
if 'init_wait' in link_watch_opts:
print("# Warn: option link_watch.init_wait: %d is not supported by bonding" % link_watch_opts['init_wait'])
- if 'missed_max' in link_watch_opts:
- print("# Warn: option link_watch.missed_max: %d is not supported by bonding" % link_watch_opts['missed_max'])
if 'source_host' in link_watch_opts:
print("# Warn: option link_watch.source_host: %s is not supported by bonding" % link_watch_opts['source_host'])
if 'vlanid' in link_watch_opts:
--
2.38.1