mirroring: Preserve key for disabling learning.
authorJesse Gross <jesse@nicira.com>
Wed, 11 Nov 2009 22:48:48 +0000 (14:48 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 12 Nov 2009 00:00:05 +0000 (16:00 -0800)
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
xenserver/etc_init.d_vswitch
xenserver/etc_xensource_scripts_vif
xenserver/opt_xensource_libexec_interface-reconfigure

index 8e9739fddf22f0fe5a7bce2f3002b482c2247e7f..276f49640f946a166402ce843611c3cb3533eebd 100644 (file)
@@ -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,
index f0b8be2c89b82fa3547c21c08f2b43ee11f76bcb..4050d5ae0e137b7dc31114ed2d7fb921bf48795b 100755 (executable)
@@ -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
index 8217fb00cb49daa143fe363b806366c8fee8577e..572f5af0ca4f41c62106cf7ac1ccc19f6bc7c52d 100755 (executable)
@@ -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
        ;;
index 59036a561fc29e3555446f1398d21ad3b39717e3..1d91675d15c6809ee7fea12e9652aee48a26d13b 100755 (executable)
@@ -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():