[ovs-dev] [PATCH 2/2] ovsschema: Avoid using 'protected' as variable name

Yi-Hung Wei yihung.wei at gmail.com
Thu Nov 30 19:11:51 UTC 2017


In C++, 'protected' is a keyword. This patch renames 'protected'
to 'is_protected' in a couple files so that C++ compiler will
not get confused.

Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
---
 ofproto/ofproto-dpif.c     | 10 +++++-----
 ofproto/ofproto.h          |  2 +-
 vswitchd/bridge.c          |  2 +-
 vswitchd/vswitch.ovsschema |  6 +++---
 vswitchd/vswitch.xml       |  2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index b99f04fad300..36de557bd9a8 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -103,7 +103,7 @@ struct ofbundle {
     struct bond *bond;          /* Nonnull iff more than one port. */
     bool use_priority_tags;     /* Use 802.1p tag for frames in VLAN 0? */
 
-    bool protected;             /* Protected port mode */
+    bool is_protected;             /* Protected port mode */
 
     /* Status. */
     bool floodable;          /* True if no port has OFPUTIL_PC_NO_FLOOD set. */
@@ -456,7 +456,7 @@ type_run(const char *type)
                                  bundle->vlan, bundle->trunks, bundle->cvlans,
                                  bundle->use_priority_tags,
                                  bundle->bond, bundle->lacp,
-                                 bundle->floodable, bundle->protected);
+                                 bundle->floodable, bundle->is_protected);
             }
 
             HMAP_FOR_EACH (ofport, up.hmap_node, &ofproto->up.ports) {
@@ -3049,7 +3049,7 @@ bundle_set(struct ofproto *ofproto_, void *aux,
         bundle->bond = NULL;
 
         bundle->floodable = true;
-        bundle->protected = false;
+        bundle->is_protected = false;
         mbridge_register_bundle(ofproto->mbridge, bundle);
     }
 
@@ -3207,8 +3207,8 @@ bundle_set(struct ofproto *ofproto_, void *aux,
     }
 
     /* Set proteced port mode */
-    if (s->protected != bundle->protected) {
-        bundle->protected = s->protected;
+    if (s->is_protected != bundle->is_protected) {
+        bundle->is_protected = s->is_protected;
         need_flush = true;
     }
 
diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
index 1e48e1952aa2..305e353a4526 100644
--- a/ofproto/ofproto.h
+++ b/ofproto/ofproto.h
@@ -414,7 +414,7 @@ struct ofproto_bundle_settings {
     struct lacp_settings *lacp;              /* Nonnull to enable LACP. */
     struct lacp_slave_settings *lacp_slaves; /* Array of n_slaves elements. */
 
-    bool protected;             /* Protected port mode */
+    bool is_protected;             /* Protected port mode */
 };
 
 int ofproto_bundle_register(struct ofproto *, void *aux,
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 630c6fa535e2..70b4e7f2d388 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -1046,7 +1046,7 @@ port_configure(struct port *port)
     }
 
     /* Protected port mode */
-    s.protected = cfg->protected;
+    s.is_protected = cfg->is_protected;
 
     /* Register. */
     ofproto_bundle_register(port->bridge->ofproto, port, &s);
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 90e50b62612b..fb64fbd93beb 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "7.15.1",
- "cksum": "3682332033 23608",
+ "version": "7.16.0",
+ "cksum": "3048577145 23611",
  "tables": {
    "Open_vSwitch": {
      "columns": {
@@ -208,7 +208,7 @@
          "type": {"key": "string", "value": "integer",
                   "min": 0, "max": "unlimited"},
          "ephemeral": true},
-       "protected": {
+       "is_protected": {
          "type": "boolean"},
        "other_config": {
          "type": {"key": "string", "value": "string",
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index c145e1a59abb..8f5fa5126482 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1941,7 +1941,7 @@
         Bridge?  See ovs-vsctl(8) for more information.
       </column>
 
-      <column name="protected" type='{"type": "boolean"}'>
+      <column name="is_protected" type='{"type": "boolean"}'>
         The protected ports feature allows certain ports to be designated as
         protected. Traffic between protected ports is blocked. Protected
         ports can send traffic to unprotected ports. Unprotected ports can
-- 
2.7.4



More information about the dev mailing list