diff mbox

[ovs-dev,v2,04/11] ovn-controller: Make indexes more broadly available.

Message ID 20161216222537.2221-5-blp@ovn.org
State Superseded
Headers show

Commit Message

Ben Pfaff Dec. 16, 2016, 10:25 p.m. UTC
This will allow binding_run() to use them in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 ovn/controller/ovn-controller.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 4fbf455..b924589 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -509,6 +509,11 @@  main(int argc, char *argv[])
         const struct ovsrec_bridge *br_int = get_br_int(&ctx);
         const char *chassis_id = get_chassis_id(ctx.ovs_idl);
 
+        struct lport_index lports;
+        struct mcgroup_index mcgroups;
+        lport_index_init(&lports, ctx.ovnsb_idl);
+        mcgroup_index_init(&mcgroups, ctx.ovnsb_idl);
+
         const struct sbrec_chassis *chassis = NULL;
         if (chassis_id) {
             chassis = chassis_run(&ctx, chassis_id, br_int);
@@ -521,11 +526,6 @@  main(int argc, char *argv[])
             patch_run(&ctx, br_int, chassis_id, &local_datapaths,
                       &patched_datapaths);
 
-            struct lport_index lports;
-            struct mcgroup_index mcgroups;
-            lport_index_init(&lports, ctx.ovnsb_idl);
-            mcgroup_index_init(&mcgroups, ctx.ovnsb_idl);
-
             enum mf_field_id mff_ovn_geneve = ofctrl_run(br_int,
                                                          &pending_ct_zones);
 
@@ -554,10 +554,10 @@  main(int argc, char *argv[])
                     }
                 }
             }
-            mcgroup_index_destroy(&mcgroups);
-            lport_index_destroy(&lports);
         }
 
+        mcgroup_index_destroy(&mcgroups);
+        lport_index_destroy(&lports);
         sset_destroy(&all_lports);
 
         struct local_datapath *cur_node, *next_node;