Compare commits
No commits in common. "c8" and "c9-beta" have entirely different histories.
@ -1 +1 @@
|
||||
4e5e0a0d0682f27a0850fac1f9bababdb991f14a SOURCES/libteam-1.31.tar.gz
|
||||
338f2bae08e143bc3f7a84317ddc3053cff2691d SOURCES/libteam-1.31.tar.gz
|
||||
|
@ -0,0 +1,339 @@
|
||||
From 7a2260a85cb14c58792273753e4f58cca358c548 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Tue, 30 Mar 2021 17:06:42 +0800
|
||||
Subject: [PATCH] team: add a tool for team to bonding config migration
|
||||
|
||||
Since we will deprecate team on RHEL9 and remove it on RHEL10, add a tool
|
||||
for team to bonding config migration.
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
man/teamd.8 | 2 +
|
||||
utils/team2bond | 302 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 304 insertions(+)
|
||||
create mode 100755 utils/team2bond
|
||||
|
||||
diff --git a/man/teamd.8 b/man/teamd.8
|
||||
index 3d27eae..652111b 100644
|
||||
--- a/man/teamd.8
|
||||
+++ b/man/teamd.8
|
||||
@@ -32,6 +32,8 @@ teamd \(em team network device control daemon
|
||||
.br
|
||||
.B teamd
|
||||
.BR \-h | \-V
|
||||
+.SH NOTE
|
||||
+Teaming is deprecated on RHEL9 and will be removed on RHEL10! For replacement please use bonding.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
teamd is a daemon to control a given team network device, during runtime,
|
||||
diff --git a/utils/team2bond b/utils/team2bond
|
||||
new file mode 100755
|
||||
index 0000000..6ac9d52
|
||||
--- /dev/null
|
||||
+++ b/utils/team2bond
|
||||
@@ -0,0 +1,302 @@
|
||||
+#!/bin/env python3
|
||||
+# vim: sts=4 ts=4 sw=4 expandtab :
|
||||
+
|
||||
+from optparse import OptionParser
|
||||
+import subprocess
|
||||
+import json
|
||||
+import sys
|
||||
+
|
||||
+def handle_cmd_line():
|
||||
+ parser = OptionParser()
|
||||
+ parser.add_option('--config', dest='config', default = '',
|
||||
+ help = "convert the team JSON format configuration file " \
|
||||
+ + "to NetworkManager connection profile, please use " \
|
||||
+ + "'teamdctl TEAM config dump' to dump the config file." \
|
||||
+ + " Note the script only convert config file. IP " \
|
||||
+ + "address configurations still need to be set manually.")
|
||||
+ parser.add_option('--rename', dest='rename', default = '',
|
||||
+ help = "rename the default team interface name." \
|
||||
+ + " Careful: firewall rules, aliases interfaces, etc., " \
|
||||
+ + "will break after the renaming because the tool " \
|
||||
+ + "will only change the config file, nothing else.")
|
||||
+ parser.add_option('--exec-cmd', dest='exec_cmd', action='store_true', default = False,
|
||||
+ help = "exec nmcli and add the connections directly " \
|
||||
+ + "instead of printing the nmcli cmd to screen. " \
|
||||
+ + "This parameter is NOT recommend, it would be good " \
|
||||
+ + "to double check the cmd before apply.")
|
||||
+
|
||||
+ (options, args) = parser.parse_args()
|
||||
+
|
||||
+ if subprocess.run(['nmcli', '-v'], stdout=subprocess.DEVNULL,
|
||||
+ stderr=subprocess.DEVNULL).returncode != 0:
|
||||
+ print("Warn: NetworkManager is needed for this script!");
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ return options
|
||||
+
|
||||
+def convert_runner_opts(runner_opts):
|
||||
+ bond_opts = ""
|
||||
+
|
||||
+ if runner_opts['name'] == 'broadcast':
|
||||
+ bond_opts = "mode=broadcast"
|
||||
+ elif runner_opts['name'] == 'roundrobin':
|
||||
+ bond_opts = "mode=balance-rr"
|
||||
+ elif runner_opts['name'] == 'activebackup':
|
||||
+ bond_opts = "mode=active-backup"
|
||||
+ if 'hwaddr_policy' in runner_opts:
|
||||
+ if runner_opts['hwaddr_policy'] == 'same_all':
|
||||
+ bond_opts += ",fail_over_mac=none"
|
||||
+ elif runner_opts['hwaddr_policy'] == 'by_active':
|
||||
+ bond_opts += ",fail_over_mac=active"
|
||||
+ elif runner_opts['hwaddr_policy'] == 'only_active':
|
||||
+ bond_opts += ",fail_over_mac=follow"
|
||||
+ else:
|
||||
+ print("# Warn: invalid runner.hwaddr_policy: " + runner_opts['hwaddr_policy'])
|
||||
+ elif runner_opts['name'] == 'loadbalance':
|
||||
+ bond_opts = "mode=balance-tlb"
|
||||
+ elif runner_opts['name'] == 'lacp':
|
||||
+ bond_opts = "mode=802.3ad"
|
||||
+ if 'active' in runner_opts:
|
||||
+ print("# Warn: option runner.active: %r is not supported by bonding" % runner_opts['active'])
|
||||
+ if 'fast_rate' in runner_opts:
|
||||
+ if runner_opts['fast_rate']:
|
||||
+ bond_opts += ",lacp_rate=1"
|
||||
+ else:
|
||||
+ bond_opts += ",lacp_rate=0"
|
||||
+ if 'sys_prio' in runner_opts:
|
||||
+ bond_opts += ",ad_actor_sys_prio=" + str(runner_opts['sys_prio'])
|
||||
+ if 'min_ports' in runner_opts:
|
||||
+ bond_opts += ",min_links=" + runner_opts['min_ports']
|
||||
+ if 'agg_select_policy' in runner_opts:
|
||||
+ if runner_opts['agg_select_policy'] == 'bandwidth':
|
||||
+ bond_opts += ",ad_select=bandwidth"
|
||||
+ elif runner_opts['agg_select_policy'] == 'count':
|
||||
+ bond_opts += ",ad_select=count"
|
||||
+ else:
|
||||
+ print("# Warn: Option runner.agg_select_policy: %s is not supported by bonding" %
|
||||
+ runner_opts['agg_select_policy'])
|
||||
+ sys.exit(1)
|
||||
+ else:
|
||||
+ print("Error: Unsupported runner.name: %s for bonding" % runner_opts['name'])
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if 'tx_hash' in runner_opts:
|
||||
+ print("# Warn: tx_hash ipv4, ipv6, tcp, udp, sctp are not supported by bonding")
|
||||
+ if 'vlan' in runner_opts['tx_hash']:
|
||||
+ bond_opts +=",xmit_hash_policy=vlan+srcmac"
|
||||
+ if 'eth' in runner_opts['tx_hash']:
|
||||
+ bond_opts +=",xmit_hash_policy=layer2"
|
||||
+ if 'l3' in runner_opts['tx_hash'] or 'ip' in runner_opts['tx_hash']:
|
||||
+ bond_opts +="+3"
|
||||
+ elif ('l3' in runner_opts['tx_hash'] or 'ip' in runner_opts['tx_hash']) \
|
||||
+ and 'l4' in runner_opts['tx_hash']:
|
||||
+ bond_opts +=",xmit_hash_policy=layer3+4"
|
||||
+
|
||||
+ if 'tx_balancer' in runner_opts:
|
||||
+ if 'name' in runner_opts['tx_balancer']:
|
||||
+ if runner_opts['tx_balancer']['name'] == 'basic':
|
||||
+ bond_opts += ",tlb_dynamic_lb=1"
|
||||
+ if 'balancing_interval' in runner_opts['tx_balancer']:
|
||||
+ print("# Warn: option runner.tx_balancer.balancing_interval: %d is not supported by bonding" %
|
||||
+ runner_opts['tx_balancer']['balancing_interval'])
|
||||
+
|
||||
+ return bond_opts
|
||||
+
|
||||
+# arp_target is used to store multi targets
|
||||
+# exist_opts is used to check if there are duplicated arp_intervals
|
||||
+def convert_link_watch(link_watch_opts, arp_target, exist_opts):
|
||||
+ bond_opts=""
|
||||
+ if 'name' not in link_watch_opts:
|
||||
+ print("Error: no link_watch.name in team config file!")
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if link_watch_opts['name'] == 'ethtool':
|
||||
+ bond_opts += ",miimon=100"
|
||||
+ if 'delay_up' in link_watch_opts:
|
||||
+ bond_opts += ",updelay=" + str(link_watch_opts['delay_up'])
|
||||
+ if 'delay_down' in link_watch_opts:
|
||||
+ bond_opts += ",downdelay=" + str(link_watch_opts['delay_down'])
|
||||
+ elif link_watch_opts['name'] == 'arp_ping':
|
||||
+ if 'interval' in link_watch_opts:
|
||||
+ if exist_opts.find('arp_interval') > 0:
|
||||
+ print("# Warn: duplicated arp_interval detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",arp_interval=" + str(link_watch_opts['interval'])
|
||||
+ if 'target_host' in link_watch_opts:
|
||||
+ arp_target.append(link_watch_opts['target_host'])
|
||||
+
|
||||
+ 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:
|
||||
+ print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",arp_validate=all"
|
||||
+ elif 'validate_active' in link_watch_opts and link_watch_opts['validate_active']:
|
||||
+ if exist_opts.find('arp_validate') > 0:
|
||||
+ print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",arp_validate=active"
|
||||
+ elif 'validate_inactive' in link_watch_opts and link_watch_opts['validate_inactive']:
|
||||
+ if exist_opts.find('arp_validate') > 0:
|
||||
+ print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",arp_validate=backup"
|
||||
+
|
||||
+ 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:
|
||||
+ print("# Warn: option link_watch.vlanid: %d is not supported by bonding" % link_watch_opts['vlanid'])
|
||||
+ if 'send_always' in link_watch_opts:
|
||||
+ print("# Warn: option link_watch.send_always: %r is not supported by bonding" % link_watch_opts['send_always'])
|
||||
+ else:
|
||||
+ print("# Error: Option link_watch.name: %s is not supported by bonding" %
|
||||
+ link_watch_opts['name'])
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ return bond_opts
|
||||
+
|
||||
+def convert_opts(bond_name, team_opts, exec_cmd):
|
||||
+ bond_opts = ""
|
||||
+
|
||||
+ # Check runner/mode first
|
||||
+ if 'runner' in team_opts:
|
||||
+ bond_opts = convert_runner_opts(team_opts['runner'])
|
||||
+ else:
|
||||
+ print("Error: No runner in team config file!")
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if 'hwaddr' in team_opts:
|
||||
+ print("# Warn: option hwaddr: %s is not supported by bonding" % team_opts['hwaddr'])
|
||||
+
|
||||
+ if 'notify_peers' in team_opts:
|
||||
+ if 'count' in team_opts['notify_peers']:
|
||||
+ bond_opts += ",num_grat_arp=" + str(team_opts['notify_peers']['count'])
|
||||
+ bond_opts += ",num_unsol_na=" + str(team_opts['notify_peers']['count'])
|
||||
+ if 'interval' in team_opts['notify_peers']:
|
||||
+ bond_opts += ",peer_notif_delay=" + str(team_opts['notify_peers']['interval'])
|
||||
+ if 'mcast_rejoin' in team_opts:
|
||||
+ if 'count' in team_opts['mcast_rejoin']:
|
||||
+ bond_opts += ",resend_igmp=" + str(team_opts['mcast_rejoin']['count'])
|
||||
+ if 'interval' in team_opts['mcast_rejoin']:
|
||||
+ print("# Warn: option mcast_rejoin.interval: %d is not supported by bonding" % team_opts['mcast_rejoin']['count'])
|
||||
+
|
||||
+ # The link_watch maybe a dict or list
|
||||
+ arp_target = list()
|
||||
+ if 'link_watch' in team_opts:
|
||||
+ if isinstance(team_opts['link_watch'], list):
|
||||
+ for link_watch_opts in team_opts['link_watch']:
|
||||
+ bond_opts += convert_link_watch(link_watch_opts, arp_target, bond_opts)
|
||||
+ elif isinstance(team_opts['link_watch'], dict):
|
||||
+ bond_opts += convert_link_watch(team_opts['link_watch'], arp_target, bond_opts)
|
||||
+ # Check link watch in team ports if we don't have global link_watch
|
||||
+ elif 'ports' in team_opts:
|
||||
+ for iface in team_opts['ports']:
|
||||
+ if 'link_watch' in team_opts['ports'][iface]:
|
||||
+ bond_opts += convert_link_watch(team_opts['ports'][iface]['link_watch'], arp_target, bond_opts)
|
||||
+ else:
|
||||
+ print("Warn: No link_watch in team config file, use miimon=100 by default")
|
||||
+ bond_opts += ",miimon=100"
|
||||
+
|
||||
+ if arp_target:
|
||||
+ bond_opts += ",arp_ip_target=" + " ".join(arp_target)
|
||||
+
|
||||
+ if exec_cmd:
|
||||
+ subprocess.run(['nmcli', 'con', 'add', 'type', 'bond', 'ifname',
|
||||
+ bond_name, 'bond.options', bond_opts])
|
||||
+ else:
|
||||
+ print('nmcli con add type bond ifname ' + bond_name \
|
||||
+ + ' bond.options "' + bond_opts + '"')
|
||||
+
|
||||
+def setup_ports(bond_name, team_opts, exec_cmd):
|
||||
+ primary = {'name': "", 'prio': -2**63, 'sticky': False}
|
||||
+ bond_ports = []
|
||||
+ prio = 0
|
||||
+
|
||||
+ if 'ports' in team_opts:
|
||||
+ for iface in team_opts['ports']:
|
||||
+ bond_ports.append(iface)
|
||||
+ if 'link_watch' in team_opts['ports'][iface] and \
|
||||
+ 'link_watch' in team_opts:
|
||||
+ print("# Warn: Option link_watch in interface %s will be ignored as we have global link_watch set!" % iface)
|
||||
+ if 'queue_id' in team_opts['ports'][iface]:
|
||||
+ print("# Warn: Option queue_id: %d on interface %s is not supported by NM yet, please see rhbz:1949127" %
|
||||
+ (team_opts['ports'][iface]['queue_id'], iface))
|
||||
+ if 'lacp_prio' in team_opts['ports'][iface]:
|
||||
+ print("# Warn: Option lacp_prio: %d on interface %s is not supported by bonding" %
|
||||
+ (team_opts['ports'][iface]['lacp_prio'], iface))
|
||||
+ if 'prio' in team_opts['ports'][iface]:
|
||||
+ prio = int(team_opts['ports'][iface]['prio'])
|
||||
+ if prio > primary['prio'] and primary['sticky'] is False:
|
||||
+ primary['name'] = iface
|
||||
+ primary['prio'] = prio
|
||||
+ if 'sticky' in team_opts['ports'][iface] and \
|
||||
+ team_opts['ports'][iface]['sticky']:
|
||||
+ primary['name'] = iface
|
||||
+ primary['sticky'] = True
|
||||
+
|
||||
+ for port in bond_ports:
|
||||
+ ret = subprocess.run(['nmcli', '-g', 'general.type', 'dev', 'show', port],
|
||||
+ stderr=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
+ if ret.returncode != 0:
|
||||
+ print("# Warn: Get dev %s type failed, will use type ethernet by default" % port)
|
||||
+ if_type = 'ethernet'
|
||||
+ elif ret.stdout.find(b'ethernet') != 0:
|
||||
+ print("# Warn: %s is not a ethernet device, please make sure the type is correct" % port)
|
||||
+ if_type = str(ret.stdout, 'utf-8').strip()
|
||||
+ else:
|
||||
+ if_type = str(ret.stdout, 'utf-8').strip()
|
||||
+
|
||||
+ if exec_cmd:
|
||||
+ subprocess.run(['nmcli', 'con', 'add', 'type', if_type,
|
||||
+ 'ifname', port, 'master', bond_name])
|
||||
+ else:
|
||||
+ print('nmcli con add type %s ifname %s master %s' % (if_type, port, bond_name))
|
||||
+
|
||||
+ if primary['name']:
|
||||
+ if exec_cmd:
|
||||
+ subprocess.run(['nmcli', 'con', 'mod', 'bond-' + bond_name,
|
||||
+ '+bond.options', "primary=" + primary['name']])
|
||||
+ else:
|
||||
+ print('nmcli con mod bond-' + bond_name \
|
||||
+ + ' +bond.options "primary=' + primary['name'] + '"')
|
||||
+
|
||||
+def main():
|
||||
+ options = handle_cmd_line()
|
||||
+ team_opts = dict()
|
||||
+
|
||||
+ if options.config:
|
||||
+ try:
|
||||
+ with open(options.config, 'r') as f:
|
||||
+ team_opts = json.load(f)
|
||||
+ except OSError as e:
|
||||
+ print(e)
|
||||
+ sys.exit(1)
|
||||
+ else:
|
||||
+ print("Error: Please supply a team config file")
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if not team_opts['device']:
|
||||
+ print("Error: No team device name in team config file")
|
||||
+ sys.exit(1)
|
||||
+
|
||||
+ if not options.exec_cmd:
|
||||
+ print("### These are the commands to configure a bond interface " +
|
||||
+ "similar to this team config:")
|
||||
+
|
||||
+ if options.rename:
|
||||
+ bond_name = options.rename
|
||||
+ else:
|
||||
+ bond_name = team_opts['device']
|
||||
+
|
||||
+ convert_opts(bond_name, team_opts, options.exec_cmd)
|
||||
+ setup_ports(bond_name, team_opts, options.exec_cmd)
|
||||
+
|
||||
+ if not options.exec_cmd:
|
||||
+ print("### After this, IP addresses, routes and so need to be reconfigured.")
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ main()
|
||||
--
|
||||
2.26.3
|
||||
|
@ -0,0 +1,67 @@
|
||||
From f961dbffb5ca769c2a87a6f1e2548e63d2a0a169 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Mon, 24 May 2021 12:58:02 +0800
|
||||
Subject: [PATCH 2/2] team2bond: fix min_ports format and add lacp_key
|
||||
|
||||
Should set to str when add min_ports to bond config.
|
||||
Also add missed lacp_key config.
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
utils/team2bond | 19 ++++++++++++++++++-
|
||||
1 file changed, 18 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/utils/team2bond b/utils/team2bond
|
||||
index 6ac9d52..265bc79 100755
|
||||
--- a/utils/team2bond
|
||||
+++ b/utils/team2bond
|
||||
@@ -66,7 +66,7 @@ def convert_runner_opts(runner_opts):
|
||||
if 'sys_prio' in runner_opts:
|
||||
bond_opts += ",ad_actor_sys_prio=" + str(runner_opts['sys_prio'])
|
||||
if 'min_ports' in runner_opts:
|
||||
- bond_opts += ",min_links=" + runner_opts['min_ports']
|
||||
+ bond_opts += ",min_links=" + str(runner_opts['min_ports'])
|
||||
if 'agg_select_policy' in runner_opts:
|
||||
if runner_opts['agg_select_policy'] == 'bandwidth':
|
||||
bond_opts += ",ad_select=bandwidth"
|
||||
@@ -214,6 +214,7 @@ def convert_opts(bond_name, team_opts, exec_cmd):
|
||||
def setup_ports(bond_name, team_opts, exec_cmd):
|
||||
primary = {'name': "", 'prio': -2**63, 'sticky': False}
|
||||
bond_ports = []
|
||||
+ lacp_key = 0
|
||||
prio = 0
|
||||
|
||||
if 'ports' in team_opts:
|
||||
@@ -228,6 +229,15 @@ def setup_ports(bond_name, team_opts, exec_cmd):
|
||||
if 'lacp_prio' in team_opts['ports'][iface]:
|
||||
print("# Warn: Option lacp_prio: %d on interface %s is not supported by bonding" %
|
||||
(team_opts['ports'][iface]['lacp_prio'], iface))
|
||||
+ if 'lacp_key' in team_opts['ports'][iface]:
|
||||
+ if lacp_key == 0:
|
||||
+ lacp_key = team_opts['ports'][iface]['lacp_key']
|
||||
+ if lacp_key < 0 or lacp_key > 1023:
|
||||
+ lacp_key = 0
|
||||
+ print("# Warn: Option lacp_key: Invalid value %d for port %s" % (lacp_key, iface))
|
||||
+ else:
|
||||
+ print("# Warn: Option lacp_key: already has one key %d, ignore the new one %d" %
|
||||
+ (lacp_key, team_opts['ports'][iface]['lacp_key']))
|
||||
if 'prio' in team_opts['ports'][iface]:
|
||||
prio = int(team_opts['ports'][iface]['prio'])
|
||||
if prio > primary['prio'] and primary['sticky'] is False:
|
||||
@@ -256,6 +266,13 @@ def setup_ports(bond_name, team_opts, exec_cmd):
|
||||
else:
|
||||
print('nmcli con add type %s ifname %s master %s' % (if_type, port, bond_name))
|
||||
|
||||
+ if lacp_key != 0:
|
||||
+ if exec_cmd:
|
||||
+ subprocess.run(['nmcli', 'con', 'mod', 'bond-' + bond_name,
|
||||
+ '+bond.options', "ad_user_port_key=" + str(lacp_key)])
|
||||
+ else:
|
||||
+ print('nmcli con mod bond-' + bond_name \
|
||||
+ + ' +bond.options "ad_user_port_key=' + str(lacp_key) + '"')
|
||||
if primary['name']:
|
||||
if exec_cmd:
|
||||
subprocess.run(['nmcli', 'con', 'mod', 'bond-' + bond_name,
|
||||
--
|
||||
2.26.3
|
||||
|
@ -0,0 +1,79 @@
|
||||
From ad9cf008dfed4918e3d1e521647e5f44f46bfc91 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Wed, 21 Jul 2021 14:23:55 +0800
|
||||
Subject: [PATCH 3/4] utils/team2bond: add cautions for the script
|
||||
|
||||
Split the exec-cmd to Dangerous groups and add cautions to let customer
|
||||
know they need to remove old team device. Also fix a typo.
|
||||
|
||||
Add parameter "actual" when dump team config.
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
utils/team2bond | 19 +++++++++++++------
|
||||
1 file changed, 13 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/utils/team2bond b/utils/team2bond
|
||||
index 265bc79..118f38b 100755
|
||||
--- a/utils/team2bond
|
||||
+++ b/utils/team2bond
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/env python3
|
||||
# vim: sts=4 ts=4 sw=4 expandtab :
|
||||
|
||||
-from optparse import OptionParser
|
||||
+from optparse import OptionParser, OptionGroup
|
||||
import subprocess
|
||||
import json
|
||||
import sys
|
||||
@@ -11,7 +11,7 @@ def handle_cmd_line():
|
||||
parser.add_option('--config', dest='config', default = '',
|
||||
help = "convert the team JSON format configuration file " \
|
||||
+ "to NetworkManager connection profile, please use " \
|
||||
- + "'teamdctl TEAM config dump' to dump the config file." \
|
||||
+ + "'teamdctl TEAM config dump [actual]' to dump the config file." \
|
||||
+ " Note the script only convert config file. IP " \
|
||||
+ "address configurations still need to be set manually.")
|
||||
parser.add_option('--rename', dest='rename', default = '',
|
||||
@@ -19,11 +19,17 @@ def handle_cmd_line():
|
||||
+ " Careful: firewall rules, aliases interfaces, etc., " \
|
||||
+ "will break after the renaming because the tool " \
|
||||
+ "will only change the config file, nothing else.")
|
||||
- parser.add_option('--exec-cmd', dest='exec_cmd', action='store_true', default = False,
|
||||
+
|
||||
+ group = OptionGroup(parser, 'Dangerous Options',
|
||||
+ "Caution: You need to dump the team configuration " \
|
||||
+ "file first and then delete old team device to avoid " \
|
||||
+ "device name conflicts.")
|
||||
+ group.add_option('--exec-cmd', dest='exec_cmd', action='store_true', default = False,
|
||||
help = "exec nmcli and add the connections directly " \
|
||||
+ "instead of printing the nmcli cmd to screen. " \
|
||||
- + "This parameter is NOT recommend, it would be good " \
|
||||
+ + "This parameter is NOT recommended, it would be good " \
|
||||
+ "to double check the cmd before apply.")
|
||||
+ parser.add_option_group(group)
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
@@ -302,7 +308,8 @@ def main():
|
||||
|
||||
if not options.exec_cmd:
|
||||
print("### These are the commands to configure a bond interface " +
|
||||
- "similar to this team config:")
|
||||
+ "similar to this team config (remember to remove the old team " +
|
||||
+ "device before exec the following cmds):")
|
||||
|
||||
if options.rename:
|
||||
bond_name = options.rename
|
||||
@@ -313,7 +320,7 @@ def main():
|
||||
setup_ports(bond_name, team_opts, options.exec_cmd)
|
||||
|
||||
if not options.exec_cmd:
|
||||
- print("### After this, IP addresses, routes and so need to be reconfigured.")
|
||||
+ print("### After this, IP addresses, routes, and so on, need to be configured.")
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
--
|
||||
2.31.1
|
||||
|
99
SOURCES/0004-man-add-team2bond-man-doc.patch
Normal file
99
SOURCES/0004-man-add-team2bond-man-doc.patch
Normal file
@ -0,0 +1,99 @@
|
||||
From ff20b5982cf674e8a0a7267645963a79d2e46729 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Wed, 21 Jul 2021 17:31:59 +0800
|
||||
Subject: [PATCH 4/4] man: add team2bond man doc
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
man/Makefile.am | 2 +-
|
||||
man/team2bond.1 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 70 insertions(+), 1 deletion(-)
|
||||
create mode 100644 man/team2bond.1
|
||||
|
||||
diff --git a/man/Makefile.am b/man/Makefile.am
|
||||
index 4c63629..52f0fb9 100644
|
||||
--- a/man/Makefile.am
|
||||
+++ b/man/Makefile.am
|
||||
@@ -1,3 +1,3 @@
|
||||
dist_man8_MANS = teamd.8 teamdctl.8 teamnl.8
|
||||
dist_man5_MANS = teamd.conf.5
|
||||
-dist_man1_MANS = bond2team.1
|
||||
+dist_man1_MANS = bond2team.1 team2bond.1
|
||||
diff --git a/man/team2bond.1 b/man/team2bond.1
|
||||
new file mode 100644
|
||||
index 0000000..f47aba4
|
||||
--- /dev/null
|
||||
+++ b/man/team2bond.1
|
||||
@@ -0,0 +1,69 @@
|
||||
+.TH TEAM2BOND 1 "2021-07-20" "libteam" "Team to Bonding conversion tool"
|
||||
+.SH NAME
|
||||
+team2bond \(em Converts a team configuration to a NetworkManager bond configuration
|
||||
+.SH SYNOPSIS
|
||||
+.B team2bond
|
||||
+.RB [options]
|
||||
+.SH DESCRIPTION
|
||||
+.PP
|
||||
+team2bond is a tool to convert team options to bonding options. During the conversion, team2bond tries to create a bond configuration that has the same or similar functionality as the team.
|
||||
+.PP
|
||||
+This tool converts a team JSON format configuration file to NetworkManager nmcli commands that you can use to set up a network bonding device. After verifying the commands and deleting the corresponding team device, run the nmcli commands manually or with parameter
|
||||
+.B \-\-exec
|
||||
+to create the NetworkManager connection profile.
|
||||
+.PP
|
||||
+.B Important:
|
||||
+Note that deleting the team device makes this connection unavailable until you recreated the bond.
|
||||
+.SH OPTIONS
|
||||
+.TP
|
||||
+.B "\-\-config <team json config file>"
|
||||
+Specifies the team JSON format configuration file to convert. Use the 'teamdctl <TEAMNAME> config dump [actual]' command to create the JSON file.
|
||||
+.TP
|
||||
+.B "\-\-rename <interface>"
|
||||
+This is a convenient option to replace the original interface name with the specified name. For example, use \-\-rename bond0 to change the interface name to bond0. Note, firewall rules, alias interfaces, and so on, that are tied to the original interface name can break after the renaming an interface because the tool only changes the NetworkManager profile.
|
||||
+.TP
|
||||
+.B "\-\-help"
|
||||
+Print a help text to console and exit.
|
||||
+.SH DANGEROUS OPTION
|
||||
+.TP
|
||||
+.B "\-\-exec"
|
||||
+Executes the generated nmcli commands and adds the connections directly instead of printing then to the screen. This parameter is NOT recommended. Double-check the generated commands before you apply them.
|
||||
+.SH EXAMPLE STEPS
|
||||
+.TP
|
||||
+1. Save the current 'team0' ip addresses, firewall rules, alias, etc.
|
||||
+.TP
|
||||
+2. Dump the current 'team0' configuration to a JSON file. Using the 'actual' option, team2bond dumps the actual config instead of the initial config:
|
||||
+.TP
|
||||
+.RS 1
|
||||
+# teamdctl team0 config dump actual > team0.json
|
||||
+.RE
|
||||
+.TP
|
||||
+3. Run the team2bond utility in dry-run mode to display nmcli commands that set up a network bond with similar settings as the team device:
|
||||
+.TP
|
||||
+.RS 1
|
||||
+# team2bond \%--config team0.json
|
||||
+.RE
|
||||
+.TP
|
||||
+To convert the current 'team0' configuration to bonding connection profile and rename the interface name to 'bond0':
|
||||
+.TP
|
||||
+.RS 1
|
||||
+# team2bond \%--config team0.json \%--rename bond0
|
||||
+.RE
|
||||
+.TP
|
||||
+4. Examine these generated nmcli commands, and make sure all parameters are correct.
|
||||
+.TP
|
||||
+5. Delete the team0 device by using the teamd or nmcli utility to avoid a device conflict. Then execute the commands the team2bond utility displayed in the previous step manually or use the \-\-exec option:
|
||||
+.TP
|
||||
+.RS 1
|
||||
+# team2bond \%--config team0.json \%--rename bond0 \%--exec
|
||||
+.RE
|
||||
+.SH CAVEATS
|
||||
+.PP
|
||||
+The tool will not convert any other configuration which might be tied to the current setup. For instance, IP addresses, firewall rules, alias interfaces, bridges, and so on.
|
||||
+.SH AUTHOR
|
||||
+.PP
|
||||
+Hangbin Liu <haliu@redhat.com>
|
||||
+.SH SEE ALSO
|
||||
+.BR nmcli (1),
|
||||
+.BR teamdctl (8),
|
||||
+.BR teamd.conf (5).
|
||||
--
|
||||
2.31.1
|
||||
|
@ -1,5 +1,4 @@
|
||||
From 61efd6de2fbb8ee077863ee5a355ac3dfd9365b9 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <61efd6de2fbb8ee077863ee5a355ac3dfd9365b9.1599144624.git.lucien.xin@gmail.com>
|
||||
From: Xin Long <lucien.xin@gmail.com>
|
||||
Date: Tue, 1 Sep 2020 13:59:27 +0800
|
||||
Subject: [PATCH] Revert "teamd: Disregard current state when considering port
|
||||
@ -51,5 +50,5 @@ index 166da57..d429753 100644
|
||||
else
|
||||
return 0;
|
||||
--
|
||||
2.18.1
|
||||
2.27.0
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 5616af4387302e9e6ec07dd5466f4a0e93c50a59 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Mon, 7 Mar 2022 14:39:25 +0800
|
||||
Subject: [PATCH 6/6] utils/team2bond: do not add miimon if already exist
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
utils/team2bond | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/utils/team2bond b/utils/team2bond
|
||||
index 118f38b..b5555c1 100755
|
||||
--- a/utils/team2bond
|
||||
+++ b/utils/team2bond
|
||||
@@ -117,7 +117,8 @@ def convert_link_watch(link_watch_opts, arp_target, exist_opts):
|
||||
sys.exit(1)
|
||||
|
||||
if link_watch_opts['name'] == 'ethtool':
|
||||
- bond_opts += ",miimon=100"
|
||||
+ if exist_opts.find("miimon") == -1:
|
||||
+ bond_opts += ",miimon=100"
|
||||
if 'delay_up' in link_watch_opts:
|
||||
bond_opts += ",updelay=" + str(link_watch_opts['delay_up'])
|
||||
if 'delay_down' in link_watch_opts:
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,79 @@
|
||||
From de84fb3debdf55080bafbf015d76989c17276d01 Mon Sep 17 00:00:00 2001
|
||||
From: Hangbin Liu <haliu@redhat.com>
|
||||
Date: Mon, 16 May 2022 15:40:35 +0800
|
||||
Subject: [PATCH 7/1] utils/team2bond: do not add updelay/downdelay if already exist
|
||||
|
||||
Also check if miimon/arp_interval already set.
|
||||
|
||||
Signed-off-by: Hangbin Liu <haliu@redhat.com>
|
||||
---
|
||||
utils/team2bond | 32 +++++++++++++++++++++++++-------
|
||||
1 file changed, 25 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/utils/team2bond b/utils/team2bond
|
||||
index b5555c1..111b83b 100755
|
||||
--- a/utils/team2bond
|
||||
+++ b/utils/team2bond
|
||||
@@ -117,34 +117,52 @@ def convert_link_watch(link_watch_opts, arp_target, exist_opts):
|
||||
sys.exit(1)
|
||||
|
||||
if link_watch_opts['name'] == 'ethtool':
|
||||
- if exist_opts.find("miimon") == -1:
|
||||
+ if exist_opts.find("arp_interval") >= 0:
|
||||
+ print("# Warn: detecte miimon(ethtool) setting, but arp_interval(arp_ping) already set, will ignore.")
|
||||
+ return bond_opts
|
||||
+
|
||||
+ if exist_opts.find("miimon") >= 0:
|
||||
+ print("# Warn: duplicated miimon detected, bonding supports only one.")
|
||||
+ else:
|
||||
bond_opts += ",miimon=100"
|
||||
+
|
||||
if 'delay_up' in link_watch_opts:
|
||||
- bond_opts += ",updelay=" + str(link_watch_opts['delay_up'])
|
||||
+ if exist_opts.find('updelay') >= 0:
|
||||
+ print("# Warn: duplicated updelay detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",updelay=" + str(link_watch_opts['delay_up'])
|
||||
if 'delay_down' in link_watch_opts:
|
||||
- bond_opts += ",downdelay=" + str(link_watch_opts['delay_down'])
|
||||
+ if exist_opts.find('downdelay') >= 0:
|
||||
+ print("# Warn: duplicated downdelay detected, bonding supports only one.")
|
||||
+ else:
|
||||
+ bond_opts += ",downdelay=" + str(link_watch_opts['delay_down'])
|
||||
elif link_watch_opts['name'] == 'arp_ping':
|
||||
+ if exist_opts.find("miimon") >= 0:
|
||||
+ print("# Warn: detecte arp_interval(arp_ping) setting, but miimon(ethtool) already set, will ignore.")
|
||||
+ return bond_opts
|
||||
+
|
||||
if 'interval' in link_watch_opts:
|
||||
- if exist_opts.find('arp_interval') > 0:
|
||||
+ if exist_opts.find('arp_interval') >= 0:
|
||||
print("# Warn: duplicated arp_interval detected, bonding supports only one.")
|
||||
else:
|
||||
bond_opts += ",arp_interval=" + str(link_watch_opts['interval'])
|
||||
+
|
||||
if 'target_host' in link_watch_opts:
|
||||
arp_target.append(link_watch_opts['target_host'])
|
||||
|
||||
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:
|
||||
+ if exist_opts.find('arp_validate') >= 0:
|
||||
print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
else:
|
||||
bond_opts += ",arp_validate=all"
|
||||
elif 'validate_active' in link_watch_opts and link_watch_opts['validate_active']:
|
||||
- if exist_opts.find('arp_validate') > 0:
|
||||
+ if exist_opts.find('arp_validate') >= 0:
|
||||
print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
else:
|
||||
bond_opts += ",arp_validate=active"
|
||||
elif 'validate_inactive' in link_watch_opts and link_watch_opts['validate_inactive']:
|
||||
- if exist_opts.find('arp_validate') > 0:
|
||||
+ if exist_opts.find('arp_validate') >= 0:
|
||||
print("# Warn: duplicated arp_validate detected, bonding supports only one.")
|
||||
else:
|
||||
bond_opts += ",arp_validate=backup"
|
||||
--
|
||||
2.35.1
|
||||
|
@ -1,61 +0,0 @@
|
||||
From 3bbce8a171deab6cd3d7d57d128bc2dbaea451f0 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <3bbce8a171deab6cd3d7d57d128bc2dbaea451f0.1664556124.git.lucien.xin@gmail.com>
|
||||
From: Xin Long <lucien.xin@gmail.com>
|
||||
Date: Fri, 15 Apr 2022 11:41:39 -0400
|
||||
Subject: [PATCH] libteamdctl: validate the bus name before using it
|
||||
|
||||
Using bus name without validating it will cause core dump generated,
|
||||
and it can be reproduced by:
|
||||
|
||||
# ip link add dummy0.1 type dummy
|
||||
# teamdctl dummy0.1 state dump
|
||||
|
||||
This is normally a bug in some application using the D-Bus library.
|
||||
|
||||
D-Bus not built with -rdynamic so unable to print a backtrace
|
||||
Aborted (core dumped)
|
||||
|
||||
Doing this many times can even create too many core files, customers
|
||||
may complain about it.
|
||||
|
||||
This is triggered when calling cli_method_call("ConfigDump") in
|
||||
cli_init(), so fix it by returning err in cli->init/cli_dbus_init()
|
||||
if the bus name fails to validate.
|
||||
|
||||
Note this is safe, as with dbus, we can't use invalid dbus name to
|
||||
create the team dev either.
|
||||
|
||||
Fixes: d8163e34c25c ("libteamdctl: do test method call instead or Introspect call")
|
||||
Reported-by: Uday Patel <upatel@redhat.com>
|
||||
Signed-off-by: Xin Long <lucien.xin@gmail.com>
|
||||
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
|
||||
---
|
||||
libteamdctl/cli_dbus.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libteamdctl/cli_dbus.c b/libteamdctl/cli_dbus.c
|
||||
index dfef5c4..242ef86 100644
|
||||
--- a/libteamdctl/cli_dbus.c
|
||||
+++ b/libteamdctl/cli_dbus.c
|
||||
@@ -183,12 +183,17 @@ static int cli_dbus_init(struct teamdctl *tdc, const char *team_name, void *priv
|
||||
if (ret == -1)
|
||||
return -errno;
|
||||
|
||||
+ err = -EINVAL;
|
||||
dbus_error_init(&error);
|
||||
+ if (!dbus_validate_bus_name(cli_dbus->service_name, &error)) {
|
||||
+ err(tdc, "dbus: Could not validate bus name: %s - %s",
|
||||
+ error.name, error.message);
|
||||
+ goto free_service_name;
|
||||
+ }
|
||||
cli_dbus->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
|
||||
if (!cli_dbus->conn) {
|
||||
err(tdc, "dbus: Could not acquire the system bus: %s - %s",
|
||||
error.name, error.message);
|
||||
- err = -EINVAL;
|
||||
goto free_service_name;
|
||||
}
|
||||
err = 0;
|
||||
--
|
||||
2.27.0
|
||||
|
@ -1,24 +1,33 @@
|
||||
Name: libteam
|
||||
Version: 1.31
|
||||
Release: 4%{?dist}
|
||||
Release: 16%{?dist}
|
||||
Summary: Library for controlling team network device
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2+
|
||||
URL: http://www.libteam.org
|
||||
Source: http://www.libteam.org/files/libteam-%{version}.tar.gz
|
||||
Patch1: libteam-Revert-teamd-Disregard-current-state-when-considerin.patch
|
||||
Patch2: libteamdctl-validate-the-bus-name-before-using-it.patch
|
||||
Patch3: libteam-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch
|
||||
Patch4: libteam-teamd-stop-iterating-callbacks-when-a-loop-restart-i.patch
|
||||
|
||||
Patch1: 0001-team-add-a-tool-for-team-to-bonding-config-migration.patch
|
||||
Patch2: 0002-team2bond-fix-min_ports-format-and-add-lacp_key.patch
|
||||
Patch3: 0003-utils-team2bond-add-cautions-for-the-script.patch
|
||||
Patch4: 0004-man-add-team2bond-man-doc.patch
|
||||
Patch5: 0005-Revert-teamd-Disregard-current-state-when-considerin.patch
|
||||
Patch6: 0006-utils-team2bond-do-not-add-miimon-if-already-exist.patch
|
||||
Patch7: 0007-utils-team2bond-do-not-add-updelay-downdelay-if-alre.patch
|
||||
Patch8: 0008-teamd-do-no-remove-the-ports-on-shutdown-with-N.patch
|
||||
Patch9: 0009-teamd-stop-iterating-callbacks-when-a-loop-restart-i.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: jansson-devel
|
||||
BuildRequires: libdaemon-devel
|
||||
BuildRequires: libnl3-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: systemd
|
||||
BuildRequires: swig
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: autoconf automake libtool
|
||||
BuildRequires: systemd-units
|
||||
BuildRequires: make
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
|
||||
%description
|
||||
This package contains a library which is a user-space
|
||||
@ -26,12 +35,10 @@ counterpart for team network driver. It provides an API
|
||||
to control team network devices.
|
||||
|
||||
%package devel
|
||||
Group: Development/Libraries
|
||||
Summary: Libraries and header files for libteam development
|
||||
Requires: libteam = %{version}-%{release}
|
||||
|
||||
%package doc
|
||||
Group: Documentation
|
||||
Summary: API documentation for libteam and libteamd
|
||||
Requires: libteam = %{version}-%{release}
|
||||
|
||||
@ -39,24 +46,15 @@ Requires: libteam = %{version}-%{release}
|
||||
This package contains libteam and libteamd API documentation
|
||||
|
||||
%package -n teamd
|
||||
Group: System Environment/Daemons
|
||||
Summary: Team network device control daemon
|
||||
Requires: libteam = %{version}-%{release}
|
||||
|
||||
%package -n teamd-devel
|
||||
Group: Development/Libraries
|
||||
Summary: Libraries and header files for teamd development
|
||||
Requires: teamd = %{version}-%{release}
|
||||
|
||||
%package -n python3-libteam
|
||||
%{?python_provide:%python_provide python3-libteam}
|
||||
Group: Development/Libraries
|
||||
Summary: Team network device library bindings
|
||||
Requires: libteam = %{version}-%{release}
|
||||
|
||||
%package -n network-scripts-team
|
||||
Group: Development/Libraries
|
||||
Summary: libteam legacy network service support
|
||||
%package -n network-scripts-teamd
|
||||
Summary: teamd legacy network service support
|
||||
Requires: network-scripts
|
||||
Supplements: (teamd and network-scripts)
|
||||
|
||||
@ -71,17 +69,9 @@ The teamd package contains team network device control daemon.
|
||||
The teamd-devel package contains the header files and libraries
|
||||
necessary for developing programs using libteamdctl.
|
||||
|
||||
%description -n python3-libteam
|
||||
The team-python package contains a module that permits applications
|
||||
written in the Python programming language to use the interface
|
||||
supplied by team network device library.
|
||||
|
||||
This package should be installed if you want to develop Python
|
||||
programs that will manipulate team network devices.
|
||||
|
||||
%description -n network-scripts-team
|
||||
This provides the ifup and ifdown scripts for libteam use with the legacy
|
||||
network service.
|
||||
%description -n network-scripts-teamd
|
||||
This provides the ifup and ifdown scripts for use with the legacy network
|
||||
service.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
@ -89,18 +79,13 @@ autoreconf --force --install -I m4
|
||||
|
||||
# prepare example dir for -devel
|
||||
mkdir -p _tmpdoc1/examples
|
||||
rm examples/python/*.py
|
||||
cp -p examples/*.c _tmpdoc1/examples
|
||||
# prepare example dir for team-python
|
||||
mkdir -p _tmpdoc2/examples
|
||||
cp -p examples/python/*.py _tmpdoc2/examples
|
||||
chmod -x _tmpdoc2/examples/*.py
|
||||
|
||||
%build
|
||||
%configure --disable-static
|
||||
make %{?_smp_mflags}
|
||||
make html
|
||||
cd binding/python
|
||||
%py3_build
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
|
||||
@ -116,114 +101,153 @@ install -p -m 755 teamd/redhat/initscripts_systemd/network-scripts/ifdown-Team $
|
||||
install -p -m 755 teamd/redhat/initscripts_systemd/network-scripts/ifup-TeamPort $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/network-scripts
|
||||
install -p -m 755 teamd/redhat/initscripts_systemd/network-scripts/ifdown-TeamPort $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/network-scripts
|
||||
install -p -m 755 utils/bond2team $RPM_BUILD_ROOT%{_bindir}/bond2team
|
||||
cd binding/python
|
||||
%py3_install
|
||||
install -p -m 755 utils/team2bond $RPM_BUILD_ROOT%{_bindir}/team2bond
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc COPYING
|
||||
%license COPYING
|
||||
%{_libdir}/libteam.so.*
|
||||
%{_bindir}/teamnl
|
||||
%{_mandir}/man8/teamnl.8*
|
||||
|
||||
%files devel
|
||||
%doc COPYING _tmpdoc1/examples
|
||||
%doc _tmpdoc1/examples
|
||||
%{_includedir}/team.h
|
||||
%{_libdir}/libteam.so
|
||||
%{_libdir}/pkgconfig/libteam.pc
|
||||
|
||||
%files doc
|
||||
%doc COPYING doc/api
|
||||
%doc doc/api
|
||||
|
||||
%files -n teamd
|
||||
%doc COPYING teamd/example_configs teamd/redhat/example_ifcfgs/
|
||||
%doc teamd/example_configs teamd/redhat/example_ifcfgs/
|
||||
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/teamd.conf
|
||||
%config(noreplace) %attr(644,root,root) %{_unitdir}/teamd@.service
|
||||
%{_libdir}/libteamdctl.so.*
|
||||
%{_bindir}/teamd
|
||||
%{_bindir}/teamdctl
|
||||
%{_bindir}/bond2team
|
||||
%{_bindir}/team2bond
|
||||
%{_mandir}/man8/teamd.8*
|
||||
%{_mandir}/man8/teamdctl.8*
|
||||
%{_mandir}/man5/teamd.conf.5*
|
||||
%{_mandir}/man1/bond2team.1*
|
||||
%{_mandir}/man1/team2bond.1*
|
||||
|
||||
%files -n teamd-devel
|
||||
%doc COPYING
|
||||
%{_includedir}/teamdctl.h
|
||||
%{_libdir}/libteamdctl.so
|
||||
%{_libdir}/pkgconfig/libteamdctl.pc
|
||||
|
||||
%files -n python3-libteam
|
||||
%doc COPYING _tmpdoc2/examples
|
||||
%{python3_sitearch}/*
|
||||
|
||||
%files -n network-scripts-team
|
||||
%files -n network-scripts-teamd
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifup-Team
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifdown-Team
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifup-TeamPort
|
||||
%{_sysconfdir}/sysconfig/network-scripts/ifdown-TeamPort
|
||||
|
||||
%changelog
|
||||
* Mon Dec 05 2022 Xin Long <lxin@redhat.com> - 1.31-4
|
||||
- teamd: do no remove the ports on shutdown with -N [2148856]
|
||||
- teamd: stop iterating callbacks when a loop restart is requested [2148855]
|
||||
* Fri Sep 30 2022 Xin Long <lxin@redhat.com> - 1.31-3
|
||||
- libteamdctl: validate the bus name before using it [2065227]
|
||||
* Tue Sep 01 2020 Xin Long <lxin@redhat.com> - 1.31-2
|
||||
- Revert "teamd: Disregard current state when considering port enablement" [1874001]
|
||||
* Thu Jul 30 2020 Xin Long <lxin@redhat.com> - 1.31-1
|
||||
- 1.31 release
|
||||
- utils/bond2team: remove TYPE in ifcfg file [1858518]
|
||||
- utils/bond2team: keep delivering config to file if stdout not supplied [1858518]
|
||||
- teamd/lacp: silence ignore none LACP frames
|
||||
- Send LACP PDU right after the Actor state has been changed
|
||||
- Skip setting the same hwaddr to a lag port if not needed
|
||||
- Make all netlink socket RCVBUF sizes configurable
|
||||
- Don't return an error when timerfd socket return 0
|
||||
- Fix ifinfo_link_with_port race condition with newlink
|
||||
- teamd: fix possible race in master ifname callback
|
||||
* Tue Dec 06 2022 Long Xin <lxin@redhat.com> - 1.31-16
|
||||
- fix the Requires package name for teamd-devel
|
||||
- teamd: stop iterating callbacks when a loop restart is requested (rhbz#2148852)
|
||||
|
||||
* Mon Dec 05 2022 Long Xin <lxin@redhat.com> - 1.31-15
|
||||
- teamd: do no remove the ports on shutdown with -N (rhbz#2148854)
|
||||
|
||||
* Mon Jun 13 2022 Long Xin <lxin@redhat.com> - 1.31-14
|
||||
- Rebuilt with a new version to pass the fixed gating test (rhbz#2060445)
|
||||
|
||||
* Mon May 16 2022 Hangbin Liu <haliu@redhat.com> - 1.31-13
|
||||
- utils/team2bond: do not add updelay/downdelay if already exist (rhbz#2060445)
|
||||
|
||||
* Mon Mar 7 2022 Hangbin Liu <haliu@redhat.com> - 1.31-12
|
||||
- utils/team2bond: do not add miimon if already exist (rhbz#2060445)
|
||||
|
||||
* Mon Nov 15 2021 Xin Long <lxin@redhat.com> - 1.31-11
|
||||
- Revert "teamd: Disregard current state when considering port enablement" [1894546]
|
||||
|
||||
* Mon Aug 16 2021 Hangbin Liu <haliu@redhat.com> - 1.31-10
|
||||
- Remove an extra line in spec file
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.31-9
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Wed Jul 28 2021 Hangbin Liu <haliu@redhat.com> - 1.31-8
|
||||
- Build util team2bond in teamd rpm [1986788]
|
||||
- Add some cautions to util team2bond [1986788]
|
||||
- Add team2bond man doc [1986788]
|
||||
|
||||
* Thu Jun 17 2021 Xin Long <lxin@redhat.com> - 1.31-7
|
||||
- gating: fix the wrong link of openvswitch for RHEL-9 [1970175]
|
||||
|
||||
* Mon May 24 2021 Hangbin Liu <haliu@redhat.com> - 1.31-6
|
||||
- team2bond: fix min_ports format and add lacp_key [1937155]
|
||||
|
||||
* Wed May 12 2021 Hangbin Liu <haliu@redhat.com> - 1.31-5
|
||||
- team: add a tool for team to bonding config migration [1937155]
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.31-4
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.31-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.31-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Sun Jul 26 2020 Jiri Pirko <jiri@resnulli.us> - 1.31-1
|
||||
1.31 release
|
||||
utils/bond2team: remove TYPE in ifcfg file
|
||||
utils/bond2team: keep delivering config to file if stdout not supplied
|
||||
teamd/lacp: silence ignore none LACP frames
|
||||
teamd: fix ctx->hwaddr value assignment
|
||||
Send LACP PDU right after the Actor state has been changed
|
||||
Skip setting the same hwaddr to a lag port if not needed
|
||||
Make all netlink socket RCVBUF sizes configurable
|
||||
Don't return an error when timerfd socket return 0
|
||||
Fix ifinfo_link_with_port race condition with newlink
|
||||
teamd: fix possible race in master ifname callback
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.30-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Jan 09 2020 Jiri Pirko <jiri@resnulli.us> - 1.30-1
|
||||
- 1.30 release
|
||||
- teamd: Disregard current state when considering port enablement [1851460]
|
||||
* Sat May 23 2020 Xin Long <lxin@redhat.com> - 1.29-5
|
||||
- teamd: fix ctx->hwaddr value assignment [1838952]
|
||||
* Mon May 18 2020 Xin Long <lxin@redhat.com> - 1.29-4
|
||||
- gating: fix the invalid ovs rpm link with latest version [1782427]
|
||||
* Mon May 18 2020 Xin Long <lxin@redhat.com> - 1.29-3
|
||||
- gating: fix the invalid ovs rpm link [1782427]
|
||||
* Mon May 18 2020 Xin Long <lxin@redhat.com> - 1.29-2
|
||||
- teamd/lacp: fix segfault due to NULL pointer dereference [1758073]
|
||||
- teamd: fix build error in expansion of macro teamd_log_dbgx [1758073]
|
||||
- teamd/lacp: fix segfault due to NULL pointer dereference
|
||||
- teamd: fix build error in expansion of macro teamd_log_dbgx
|
||||
- teamd: update ctx->hwaddr after setting team dev to new hwaddr
|
||||
- libteam: wapper teamd_log_dbg with teamd_log_dbgx [1758073]
|
||||
* Mon Oct 14 2019 Xin Long <lxin@redhat.com> - 1.29-1
|
||||
- man teamd.conf: update some parameter default values [1732587]
|
||||
- libteam: wapper teamd_log_dbg with teamd_log_dbgx
|
||||
- teamd: Disregard current state when considering port enablement
|
||||
- man teamd.conf: update some parameter default values
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.29-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Wed Jul 03 2019 Jiri Pirko <jiri@resnulli.us> - 1.29-1
|
||||
- 1.29 release
|
||||
- teamd: improve the error output for non-integer port prio
|
||||
- teamd: return 0 if tdport doesn't exist in teamd_config_port_set
|
||||
- teamd: add port_master_ifindex_changed for link_watch_port_watch_ops
|
||||
- initscripts: fix if/fi align
|
||||
- teamd: fix a json object memleak in get_port_obj() [1767685]
|
||||
- libteam: set netlink event socket as non-blocking [1684389]
|
||||
- teamd: fix a json object memleak in get_port_obj()
|
||||
- libteam: set netlink event socket as non-blocking
|
||||
- libteam: double NETLINK_RCVBUF to fix -ENOMEM error
|
||||
- teamd: add a default value 1000 for link_watch.interval
|
||||
* Mon Jul 15 2019 Xin Long <lxin@redhat.com> - 1.28-4
|
||||
- gating: run VM with more RAM [1722449]
|
||||
* Wed Jul 03 2019 Xin Long <lxin@redhat.com> - 1.28-3
|
||||
- teamd: return 0 if tdport doesn't exist in teamd_config_port_set [1722449]
|
||||
- teamd: improve the error output for non-integer port prio
|
||||
* Mon Apr 29 2019 Xin Long <lxin@redhat.com> - 1.28-2
|
||||
- teamd: use enabled option_changed to sync enabled to link_up for lb runner [1668132]
|
||||
- teamd: tdport has to exist if item->per_port is set in __find_by_item_path [1687336]
|
||||
- teamd: remove port if adding fails [1668744]
|
||||
* Wed Apr 17 2019 Xin Long <lxin@redhat.com> - 1.28-1
|
||||
- teamd: use enabled option_changed to sync enabled to link_up for lb runner
|
||||
- teamd: tdport has to exist if item->per_port is set in __find_by_item_path
|
||||
- teamd: remove port if adding fails
|
||||
- teamd: lacp: update port state according to partner's sync bit
|
||||
- man: fix runner.min_ports default value [1679853]
|
||||
- teamd: lw: nsna_ping: only send ns on enabled port [1671195]
|
||||
- teamd: lw: arp_ping: only check arp reply message [1663093]
|
||||
- teamd: config: update local prio to kernel [1657113]
|
||||
- man: fix runner.min_ports default value
|
||||
- teamd: lw: nsna_ping: only send ns on enabled port
|
||||
- teamd: lw: arp_ping: only check arp reply message
|
||||
- teamd: config: update local prio to kernel
|
||||
- teamnl: update help message
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.28-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Sun Dec 09 2018 Jiri Pirko <jiri@resnulli.us> - 1.28-1
|
||||
- 1.28 release
|
||||
- teamd: lacp: send LACPDU when port state transitions from DEFAULT to CURRENT
|
||||
- man teamd.conf: Document ARP Ping link_watch.vlanid option
|
||||
@ -231,29 +255,32 @@ cd binding/python
|
||||
- libteam/options: fix s32/u32 data storage on big endian
|
||||
- teamd: add an option to force log output to stdout, stderr or syslog
|
||||
- teamd: add port_master_ifindex_changed for teamd_event_watch_ops
|
||||
- utils: check to_stdout return correctly in bond2team
|
||||
- binding/python: use SWIG_FromCharPtrAndSize for Python3 support
|
||||
- man: add 'random' to the list of available runners
|
||||
- libteam: don't crash when trying to print unregistered device name
|
||||
- configure.ac: Empty LDFLAGS before checking for libnl3
|
||||
- man: fix runner.sys_prio default
|
||||
- examples: fix duplex comparison against best port
|
||||
- teamd: add port_hwaddr_changed for lacp runner
|
||||
- teamd: add port_hwaddr_changed for lb runner
|
||||
- teamd: add port_hwaddr_changed for ab runner
|
||||
- teamd: do not process lacpdu before the port ifinfo is set
|
||||
|
||||
* Thu Jan 10 2019 Xin Long <lxin@redhat.com> - 1.27-10
|
||||
- add new package network-scripts-team [1659846]
|
||||
* Tue Sep 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.27-11
|
||||
- Remove Python 2 subpackage (#1627333)
|
||||
|
||||
* Mon Aug 20 2018 Xin Long <lxin@redhat.com> - 1.27-9
|
||||
- Added patch to fix the issue that no active port is set [1618710]
|
||||
* Thu Aug 2 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.27-10
|
||||
- Properly move network-scripts dep to right package
|
||||
|
||||
* Fri Aug 03 2018 Xin Long <lxin@redhat.com> - 1.27-8
|
||||
- Add fix to only process LACPDU after port ifinfo is set
|
||||
- Add port_hwaddr_changed for ab, lb and lacp runners
|
||||
- Add patch to fix runner.sys_prio default in man docs
|
||||
- Add patch to empty LDFLAGS before checking for libnl3 in configure.ac
|
||||
- Add patch to not crash when trying to print unregistered device name
|
||||
- Add patch to use SWIG_FromCharPtrAndSize for Python3 support
|
||||
- Add patch to check to_stdout return correctly in bond2team in bond2team
|
||||
- Add 'BuildRequires: systemd-units' in libteam.spec to fix building errors
|
||||
- Add 'autoreconf --force --install -I m4' in libteam.sepc to regenerate configure
|
||||
- Remove ifup/ifdown scripts installation in libteam.sepc
|
||||
* Thu Aug 2 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.27-9
|
||||
- Move legacy network scripts into network-scripts-teamd sub package
|
||||
|
||||
* Tue Jun 26 2018 Charalampos Stratakis <cstratak@redhat.com> - 1.27-7
|
||||
- Change the python bindings to Python 3
|
||||
* Sun Jul 22 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.27-8
|
||||
- Cleanup spec, fix deps
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.27-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.27-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
Loading…
Reference in New Issue
Block a user