summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-01-31 11:23:24 -0800
committerBen Pfaff <blp@ovn.org>2018-02-01 11:21:34 -0800
commit500db308e2704fa9fc5ff69cdcd9cb3b22116e99 (patch)
tree8a5cf13bf33232372b806bcbd48c791add83a4df /ovsdb
parent4bc938ccb3124282c873084a7d11cd8bc37e27a7 (diff)
downloadopenvswitch-500db308e2704fa9fc5ff69cdcd9cb3b22116e99.tar.gz
util: Document and rely on ovs_assert() always evaluating its argument.
The ovs_assert() macro always evaluates its argument, even when NDEBUG is defined so that failure is ignored. This behavior wasn't documented, and thus a lot of code didn't rely on it. This commit documents the behavior and simplifies bits of code that heretofore didn't rely on it. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'ovsdb')
-rw-r--r--ovsdb/ovsdb-server.c4
-rw-r--r--ovsdb/replication.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c
index 7f2d19ef5..3ac7bf472 100644
--- a/ovsdb/ovsdb-server.c
+++ b/ovsdb/ovsdb-server.c
@@ -1291,11 +1291,9 @@ static void
remove_db(struct server_config *config, struct shash_node *node)
{
struct db *db;
- bool ok;
db = node->data;
- ok = ovsdb_jsonrpc_server_remove_db(config->jsonrpc, db->db);
- ovs_assert(ok);
+ ovs_assert(ovsdb_jsonrpc_server_remove_db(config->jsonrpc, db->db));
close_db(db);
shash_delete(config->all_dbs, node);
diff --git a/ovsdb/replication.c b/ovsdb/replication.c
index bac46c67f..fc9ce6472 100644
--- a/ovsdb/replication.c
+++ b/ovsdb/replication.c
@@ -118,10 +118,9 @@ replication_init(const char *sync_from_, const char *exclude_tables,
{
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);
+ ovs_assert(!set_blacklist_tables(exclude_tables, false));
replication_dbs_destroy();