]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ovn-controller: Make indexes more broadly available.
authorBen Pfaff <blp@ovn.org>
Fri, 2 Dec 2016 07:30:00 +0000 (23:30 -0800)
committerBen Pfaff <blp@ovn.org>
Tue, 20 Dec 2016 05:02:10 +0000 (21:02 -0800)
This will allow binding_run() to use them in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
ovn/controller/ovn-controller.c

index a61f2d185563765436574baf19c9f84eb907ec26..4b1f5136b43b7100e0301fac60f121cf25e3ca11 100644 (file)
@@ -505,6 +505,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);
@@ -517,11 +522,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);
 
@@ -550,10 +550,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;