[ovs-dev] [PATCH] bridge: Move tunnel_egress_iface to status column.

Ethan Jackson ethan at nicira.com
Wed Jan 5 19:59:29 UTC 2011


This commit removes the tunnel_egress_iface column from the
interface table and moves it's data to the status column.  In the
process it reverts the database to version 1.0.0.
---
 vswitchd/bridge.c          |   13 +++++++++----
 vswitchd/vswitch.ovsschema |    8 ++------
 vswitchd/vswitch.xml       |   18 +++++++++---------
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index d505b53..b8420c0 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1102,11 +1102,16 @@ dpid_from_hash(const void *data, size_t n)
 }
 
 static void
-iface_refresh_tunnel_egress(struct iface *iface)
+iface_refresh_status(struct iface *iface)
 {
-    const char *name = netdev_get_tnl_iface(iface->netdev);
+    char *key   = "tunnel_egress_iface";
+    char *value = (char *)netdev_get_tnl_iface(iface->netdev);
 
-    ovsrec_interface_set_tunnel_egress_iface(iface->cfg, name);
+    if (value) {
+        ovsrec_interface_set_status(iface->cfg, &key, &value, 1);
+    } else {
+        ovsrec_interface_set_status(iface->cfg, NULL, NULL, 0);
+    }
 }
 
 static void
@@ -1318,7 +1323,7 @@ bridge_run(void)
                         struct iface *iface = port->ifaces[j];
                         iface_refresh_stats(iface);
                         iface_refresh_cfm_stats(iface);
-                        iface_refresh_tunnel_egress(iface);
+                        iface_refresh_status(iface);
                     }
                 }
             }
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index d21a85c..a1917ee 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "1.0.1",
- "cksum": "665434435 14130",
+ "version": "1.0.0",
+ "cksum": "514853437 13985",
  "tables": {
    "Open_vSwitch": {
      "columns": {
@@ -147,10 +147,6 @@
        "ingress_policing_burst": {
          "type": {"key": {"type": "integer",
                           "minInteger": 0}}},
-       "tunnel_egress_iface": {
-         "type": {"key": {"type": "string"},
-                  "min": 0, "max": 1},
-         "ephemeral": true},
        "mac": {
          "type": {"key": {"type": "string"},
                   "min": 0, "max": 1}},
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 293634b..27ba40d 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -970,13 +970,21 @@
           Key-value pairs that report port status.  Supported status
           values are <code>type</code>-dependent.
         </p>
-        <p>The only currently defined key-value pair is:</p>
+        <p>The currently defined key-value pairs are:</p>
         <dl>
           <dt><code>source_ip</code></dt>
           <dd>The source IP address used for an IPv4 tunnel end-point,
             such as <code>gre</code> or <code>capwap</code>.  Not
             supported by all implementations.</dd>
         </dl>
+        <dl>
+            <dt><code>tunnel_egress_iface</code></dt>
+            <dd>Egress interface for tunnels.  Currently only relevant for GRE
+                and CAPWAP tunnels.  On Linux systems, this column will show
+                the name of the interface which is responsible for routing
+                traffic destined for the configured <code>remote_ip</code>.
+                This could be an internal interface such as a bridge port.</dd>
+        </dl>
       </column>
     </group>
 
@@ -1102,14 +1110,6 @@
         </dl>
       </column>
 
-      <column name="tunnel_egress_iface">
-        Egress interface for tunnels.  Currently only relevant for GRE and
-        CAPWAP tunnels.  On Linux systems, this column will show the name of
-        the interface which is responsible for routing traffic destined for the
-        configured <code>remote_ip</code>.  This could be an internal interface
-        such as a bridge port.
-      </column>
-
       <column name="other_config">
         Key-value pairs for rarely used interface features.  Currently,
         there are none defined.
-- 
1.7.2





More information about the dev mailing list