diff options
author | Ben Pfaff <blp@ovn.org> | 2018-07-25 13:58:12 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-08-03 16:24:41 -0700 |
commit | 7073a83fc731fc997dd51bfdd8cd99dd29a663ab (patch) | |
tree | f0efd66b5b3c79993cfac93537d45d9f5dac0bc9 /ovsdb/ovsdb-tool.c | |
parent | 6bf2e3f644dfe22a20584a15cc6df294e5efc4c5 (diff) | |
download | openvswitch-7073a83fc731fc997dd51bfdd8cd99dd29a663ab.tar.gz |
ovsdb-tool: Check for duplicate server IDs in "check-cluster".
The user shouldn't provide a given server's log more than once but this
check makes sure.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Diffstat (limited to 'ovsdb/ovsdb-tool.c')
-rw-r--r-- | ovsdb/ovsdb-tool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index 6832ef7c1..8ac6a1b21 100644 --- a/ovsdb/ovsdb-tool.c +++ b/ovsdb/ovsdb-tool.c @@ -1178,6 +1178,13 @@ do_check_cluster(struct ovs_cmdl_context *ctx) ovsdb_log_close(s->log); continue; } + for (size_t j = 0; j < c.n_servers; j++) { + if (uuid_equals(&s->header.sid, &c.servers[j].header.sid)) { + ovs_fatal(0, "Duplicate server ID "SID_FMT" in %s and %s.", + SID_ARGS(&s->header.sid), + s->filename, c.servers[j].filename); + } + } if (c.n_servers > 0) { struct server *s0 = &c.servers[0]; if (!uuid_equals(&s0->header.cid, &s->header.cid)) { |