Similar to what bonding has. This allows user to setup needed bridge options.
Signed-off-by: Jiri Pirko jiri@mellanox.com --- lnst/Slave/NetConfigDevice.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/lnst/Slave/NetConfigDevice.py b/lnst/Slave/NetConfigDevice.py index 5de8c73..85eef7f 100644 --- a/lnst/Slave/NetConfigDevice.py +++ b/lnst/Slave/NetConfigDevice.py @@ -174,6 +174,19 @@ class NetConfigDeviceBridge(NetConfigDeviceGeneric): def _add_rm_bridge(self, prefix): exec_cmd("brctl %sbr %s " % (prefix, self._dev_config["name"]))
+ def _get_bridge_dir(self): + return "/sys/class/net/%s/bridge" % self._dev_config["name"] + + def _setup_options(self): + if not "options" in self._dev_config: + return + options = self._dev_config["options"] + + for option, value in options: + exec_cmd('echo "%s" > %s/%s' % (value, + self._get_bridge_dir(), + option)) + def _add_rm_port(self, prefix, slave_id): port_name = self._if_manager.get_mapped_device(slave_id).get_name() exec_cmd("brctl %sif %s %s" % (prefix, self._dev_config["name"], @@ -190,6 +203,7 @@ class NetConfigDeviceBridge(NetConfigDeviceGeneric): self._add_rm_bridge("del")
def configure(self): + self._setup_options() self._add_rm_ports("add")
def deconfigure(self):
Signed-off-by: Jiri Pirko jiri@mellanox.com --- lnst-slave | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/lnst-slave b/lnst-slave index 6238769..a91df1b 100755 --- a/lnst-slave +++ b/lnst-slave @@ -58,6 +58,10 @@ def main(): else: lnst_config.load_config('/etc/lnst-slave.conf')
+ usr_cfg = os.path.expanduser('~/.lnst/lnst-slave.conf') + if os.path.isfile(usr_cfg): + lnst_config.load_config(usr_cfg) + debug = False daemon = False pidfile = "lnst-slave.pid"
On Wed, Dec 16, 2015 at 05:44:09PM +0100, Jiri Pirko wrote:
Similar to what bonding has. This allows user to setup needed bridge options.
Signed-off-by: Jiri Pirko jiri@mellanox.com
ack to series, will push later today Acked-by: Ondrej Lichtner olichtne@redhat.com
On Thu, Dec 17, 2015 at 10:59:03AM +0100, Ondrej Lichtner wrote:
On Wed, Dec 16, 2015 at 05:44:09PM +0100, Jiri Pirko wrote:
Similar to what bonding has. This allows user to setup needed bridge options.
Signed-off-by: Jiri Pirko jiri@mellanox.com
ack to series, will push later today Acked-by: Ondrej Lichtner olichtne@redhat.com
pushed, thanks
lnst-developers@lists.fedorahosted.org