Pollblock requires the run() function to be paired with a wait() function. Add one for replication.
Signed-off-by: Andy Zhou <az...@ovn.org> --- ovsdb/ovsdb-server.c | 3 +++ ovsdb/replication.c | 8 ++++++++ ovsdb/replication.h | 1 + 3 files changed, 12 insertions(+) diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 937c36e..2577401 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -183,6 +183,9 @@ main_loop(struct ovsdb_jsonrpc_server *jsonrpc, struct shash *all_dbs, } memory_wait(); + if (is_backup_server) { + replication_wait(); + } ovsdb_jsonrpc_server_wait(jsonrpc); unixctl_server_wait(unixctl); SHASH_FOR_EACH(node, all_dbs) { diff --git a/ovsdb/replication.c b/ovsdb/replication.c index f49bfe3..19626a5 100644 --- a/ovsdb/replication.c +++ b/ovsdb/replication.c @@ -112,6 +112,14 @@ replication_run(struct shash *all_dbs) } void +replication_wait(void) +{ + if (rpc) { + jsonrpc_wait(rpc); + } +} + +void set_active_ovsdb_server(const char *active_server) { active_ovsdb_server = nullable_xstrdup(active_server); diff --git a/ovsdb/replication.h b/ovsdb/replication.h index 32ea806..d80afb2 100644 --- a/ovsdb/replication.h +++ b/ovsdb/replication.h @@ -32,6 +32,7 @@ struct db { void replication_init(void); void replication_run(struct shash *dbs); +void replication_wait(void); void set_active_ovsdb_server(const char *remote_server); const char *get_active_ovsdb_server(void); void set_tables_blacklist(const char *blacklist); -- 1.9.1 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev