void replication_init(const char *sync_from_, const char *exclude_tables, const struct uuid *server) { free(sync_from); sync_from = xstrdup(sync_from_); char *err = set_blacklist_tables(exclude_tables, false); /* Caller should have verified that the 'exclude_tables' is * parseable. An error here is unexpected. */ ovs_assert(!err); replication_dbs_destroy(); shash_clear(&local_dbs); if (session) { jsonrpc_session_close(session); } session = jsonrpc_session_open(sync_from, true); session_seqno = UINT_MAX; /* Keep a copy of local server uuid. */ server_uuid = *server; state = RPL_S_INIT; }
void shash_destroy(struct shash *sh) { if (sh) { shash_clear(sh); hmap_destroy(&sh->map); } }