On Mon, Nov 30, 2015 at 04:03:01PM +0100, Erik Skultety wrote:
Since the daemon can manage and add (at fresh start) multiple
servers,
we also should be able to add them from a JSON state file in case of a
daemon restart. This patch introduces virNetDaemonAddServersPostExec
method which harvests the data about servers from a JSON file supporting
both old format with a single server and a new one storing an array of
servers. The method makes use of the original virNetDaemonAddServerPostExec,
declaring the latter as static.
Patch also updates virnetdaemontest accordingly.
There's only one thing wrong with this patch: In virnetdaemontest you
remove the ability for testing something that should've failed. You
also effectively remove one such test. Was it because you forgot about
it or did you remove it intentionally? I would prefer it to stay there.
The removal is the only thing keeping me from acking this patch.
One more tiny thing below.
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 754b6fb..b487235 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -157,7 +157,7 @@ static char *testGenerateJSON(void)
if (!(srv = testCreateServer(
has_ipv4 ? "127.0.0.1" : "::1",
Join these two lines together ^^
- has_ipv4 ? AF_INET : AF_INET6)))
+ has_ipv4 ? AF_INET : AF_INET6, server_name)))
and then indent this one accordingly.