[ovs-dev] [PATCH v2] ovn-controller: Remove unused members from local_datapath.

Ben Pfaff blp at ovn.org
Fri Dec 2 00:34:42 UTC 2016


Nothing used these, except to initialize and free them.  'logical_port'
wasn't meaningful in any case, it was just the name of the first logical
port encountered from a particular logical datapath when traversing the
database's Port_Binding table, which isn't in a meaningful order.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
v1->v2: I found some more members that were unused.

 ovn/controller/binding.c        | 2 --
 ovn/controller/ovn-controller.c | 1 -
 ovn/controller/ovn-controller.h | 3 ---
 3 files changed, 6 deletions(-)

diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
index d7b175e..fb76032 100644
--- a/ovn/controller/binding.c
+++ b/ovn/controller/binding.c
@@ -114,8 +114,6 @@ add_local_datapath(struct hmap *local_datapaths,
     }
 
     struct local_datapath *ld = xzalloc(sizeof *ld);
-    ld->logical_port = xstrdup(binding_rec->logical_port);
-    memcpy(&ld->uuid, &binding_rec->header_.uuid, sizeof ld->uuid);
     hmap_insert(local_datapaths, &ld->hmap_node,
                 binding_rec->datapath->tunnel_key);
 }
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 52eb491..45537de 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -566,7 +566,6 @@ main(int argc, char *argv[])
         struct local_datapath *cur_node, *next_node;
         HMAP_FOR_EACH_SAFE (cur_node, next_node, hmap_node, &local_datapaths) {
             hmap_remove(&local_datapaths, &cur_node->hmap_node);
-            free(cur_node->logical_port);
             free(cur_node);
         }
         hmap_destroy(&local_datapaths);
diff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h
index 78c8b08..8a3e855 100644
--- a/ovn/controller/ovn-controller.h
+++ b/ovn/controller/ovn-controller.h
@@ -53,9 +53,6 @@ struct ct_zone_pending_entry {
  * the localnet port */
 struct local_datapath {
     struct hmap_node hmap_node;
-    struct hmap_node uuid_hmap_node;
-    struct uuid uuid;
-    char *logical_port;
     const struct sbrec_port_binding *localnet_port;
 };
 
-- 
2.10.2



More information about the dev mailing list