ctdb-tests: Assign known and available arrays via pointers.
authorMartin Schwenke <martin@meltin.net>
Tue, 21 Jun 2016 05:26:05 +0000 (15:26 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 4 Jul 2016 13:42:24 +0000 (15:42 +0200)
No need to allocate these and iterate as
read_ctdb_public_ip_info_node() now returns a usable array.

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

index 541d4f6..8755abf 100644 (file)
@@ -312,11 +312,11 @@ static void ctdb_test_init(const char nodestates[],
                (*ctdb)->nodes[i] = talloc(*ctdb, struct ctdb_node);
                (*ctdb)->nodes[i]->pnn = i;
                (*ctdb)->nodes[i]->flags = nodeflags[i];
-
-               (*ipalloc_state)->available_public_ips[i] = avail[i];
-               (*ipalloc_state)->known_public_ips[i] = known[i];
        }
 
+       (*ipalloc_state)->available_public_ips = avail;
+       (*ipalloc_state)->known_public_ips = known;
+
        set_ipflags_internal(*ipalloc_state, nodemap,
                             tval_noiptakeover,
                             tval_noiptakeoverondisabled);