From 42061b2a5b79d44c0ff9442a8203f0c7672ee9cf Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 11 Nov 2009 14:48:48 -0800 Subject: [PATCH] mirroring: Preserve key for disabling learning. Don't delete the key for disabling MAC learning on a given VLAN after a reboot. Also logs when learning is disabled. --- vswitchd/bridge.c | 2 ++ xenserver/etc_init.d_vswitch | 3 ++- xenserver/etc_xensource_scripts_vif | 6 ++++-- xenserver/opt_xensource_libexec_interface-reconfigure | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 8e9739fd..276f4964 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3361,6 +3361,8 @@ mirror_reconfigure(struct bridge *br) int vlan = cfg_get_vlan(i, "vlan.%s.disable-learning", br->name); if (vlan >= 0) { bitmap_set1(rspan_vlans, vlan); + VLOG_INFO("bridge %s: disabling learning on vlan %d\n", + br->name, vlan); } else { VLOG_ERR("bridge %s: invalid value '%s' for learning disabled " "VLAN", br->name, diff --git a/xenserver/etc_init.d_vswitch b/xenserver/etc_init.d_vswitch index f0b8be2c..4050d5ae 100755 --- a/xenserver/etc_init.d_vswitch +++ b/xenserver/etc_init.d_vswitch @@ -275,7 +275,8 @@ function start { '--del-match=port.*' \ '--del-match=bonding.*' \ '--del-match=iface.*' \ - '--del-match=vlan.*' + '--del-match=vlan.*.trunks=*' \ + '--del-match=vlan.*.tag=*' fi start_vswitchd diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index 8217fb00..572f5af0 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -92,7 +92,8 @@ add_to_bridge() $cfg_mod -F /etc/ovs-vswitchd.conf \ --del-match="bridge.*.port=$vif" \ - --del-match="vlan.$vif.[!0-9]*" \ + --del-match="vlan.$vif.trunks=*" \ + --del-match="vlan.$vif.tag=*" \ --del-match="port.$vif.[!0-9]*" \ --add="bridge.$bridge.port=$vif" \ $vid $vif_details -c @@ -128,7 +129,8 @@ remove) logger -t scripts-vif "${vif} has been removed" $cfg_mod -vANY:console:emer -F /etc/ovs-vswitchd.conf \ --del-match="bridge.*.port=${vif}" \ - --del-match="vlan.${vif}.[!0-9]*" \ + --del-match="vlan.${vif}.trunks=*" \ + --del-match="vlan.${vif}.tag=*" \ --del-match="port.${vif}.[!0-9]*" -c $service vswitch reload ;; diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure index 59036a56..1d91675d 100755 --- a/xenserver/opt_xensource_libexec_interface-reconfigure +++ b/xenserver/opt_xensource_libexec_interface-reconfigure @@ -1250,7 +1250,8 @@ def datapath_deconfigure_ipdev(interface): return ['--del-match=bridge.*.port=%s' % interface, '--del-match=port.%s.[!0-9]*' % interface, '--del-match=iface.%s.[!0-9]*' % interface, - '--del-match=vlan.%s.[!0-9]*' % interface] + '--del-match=vlan.%s.trunks=*' % interface, + '--del-match=vlan.%s.tag=*' % interface] def datapath_modify_config(commands): if debug_mode(): -- 2.30.2