virnetdaemon: Store servers in a hash table

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, so post exec restart support for multiple servers is also
provided. Patch also updates virnetdaemontest accordingly.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Erik Skultety
2015-08-10 13:01:44 +02:00
parent 353de572a6
commit 252610f7dd
14 changed files with 561 additions and 234 deletions

View File

@@ -1399,7 +1399,7 @@ int main(int argc, char **argv) {
}
if (!(dmn = virNetDaemonNew()) ||
virNetDaemonAddServer(dmn, srv) < 0) {
virNetDaemonAddServer(dmn, "libvirtd", srv) < 0) {
ret = VIR_DAEMON_ERR_INIT;
goto cleanup;
}
@@ -1472,7 +1472,7 @@ int main(int argc, char **argv) {
goto cleanup;
}
if (virNetDaemonAddServer(dmn, srvAdm) < 0) {
if (virNetDaemonAddServer(dmn, "admin", srvAdm) < 0) {
ret = VIR_DAEMON_ERR_INIT;
goto cleanup;
}