ctdb-daemon: Factor out node parsing code
commit1ada9c4ef787af4097f228c4629fac99a5b9bf13
authorMartin Schwenke <martin@meltin.net>
Tue, 17 Feb 2015 04:35:07 +0000 (17 15:35 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 23 Mar 2015 11:23:12 +0000 (23 12:23 +0100)
treedee6b642ffc006ca69452a2e86c4ef2cd12f99e9
parenta5be2c245d5634695bd23387913c7e2e2481879b
ctdb-daemon: Factor out node parsing code

New function ctdb_read_nodes_file() reads a nodes file into a node
map, which is a useful intermediate format.  This function should
replace the node reading code in the ctdb CLI tool.  It will also be
useful for sanity checking of nodes files across the cluster.

New function convert_node_map_to_list() converts a node map to a node
array (and associated node count).  This fills in the details that
aren't present in the node map.  This may also useful as a separate
function later if node list reloading stages the data after a sanity
check - the approach is not yet finalised.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_server.c