- ctx.ovnnb_idl = ovnnb_idl = ovsdb_idl_create(ovnnb_db,
- &nbrec_idl_class, true, true);
-
- ctx.ovnsb_idl = ovnsb_idl = ovsdb_idl_create(ovnsb_db,
- &sbrec_idl_class, false, true);
-
- ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_logical_flow);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_logical_datapath);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_pipeline);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_table_id);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_priority);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_match);
- add_column_noalert(ovnsb_idl, &sbrec_logical_flow_col_actions);
-
- ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_multicast_group);
- add_column_noalert(ovnsb_idl, &sbrec_multicast_group_col_datapath);
- add_column_noalert(ovnsb_idl, &sbrec_multicast_group_col_tunnel_key);
- add_column_noalert(ovnsb_idl, &sbrec_multicast_group_col_name);
- add_column_noalert(ovnsb_idl, &sbrec_multicast_group_col_ports);
-
- ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_datapath_binding);
- add_column_noalert(ovnsb_idl, &sbrec_datapath_binding_col_tunnel_key);
- add_column_noalert(ovnsb_idl, &sbrec_datapath_binding_col_external_ids);
-
- ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_port_binding);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_datapath);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_logical_port);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_tunnel_key);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_parent_port);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_tag);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_type);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_options);
- add_column_noalert(ovnsb_idl, &sbrec_port_binding_col_mac);
- ovsdb_idl_add_column(ovnsb_idl, &sbrec_port_binding_col_chassis);
-
- /*
- * The loop here just runs the IDL in a loop waiting for the seqno to
- * change, which indicates that the contents of the db have changed.
- *
- * If the contents of the ovn-nb db change, the mappings to the ovn-sb
- * db must be recalculated.
- *
- * If the contents of the ovn-sb db change, it means the 'up' state of
- * a port may have changed, as that's the only type of change ovn-northd is
- * watching for.
- */
-
- ovnnb_seqno = ovsdb_idl_get_seqno(ovnnb_idl);
- ovn_seqno = ovsdb_idl_get_seqno(ovnsb_idl);
+ struct ovsdb_idl_loop ovnnb_idl_loop = OVSDB_IDL_LOOP_INITIALIZER(
+ ovsdb_idl_create(ovnnb_db, &nbrec_idl_class, true, true));
+
+ struct ovsdb_idl_loop ovnsb_idl_loop = OVSDB_IDL_LOOP_INITIALIZER(
+ ovsdb_idl_create(ovnsb_db, &sbrec_idl_class, false, true));
+
+ ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_logical_flow);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_logical_flow_col_logical_datapath);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_logical_flow_col_pipeline);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_logical_flow_col_table_id);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_logical_flow_col_priority);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_logical_flow_col_match);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_logical_flow_col_actions);
+
+ ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_multicast_group);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_multicast_group_col_datapath);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_multicast_group_col_tunnel_key);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_multicast_group_col_name);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_multicast_group_col_ports);
+
+ ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_datapath_binding);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_datapath_binding_col_tunnel_key);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_datapath_binding_col_external_ids);
+
+ ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_port_binding);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_datapath);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_port_binding_col_logical_port);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_port_binding_col_tunnel_key);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_port_binding_col_parent_port);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_tag);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_type);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_options);
+ add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_mac);
+ ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_port_binding_col_chassis);
+
+ /* Main loop. */