]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: refactor virNetServer setup for post-exec restarts
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 22 Jan 2018 17:38:55 +0000 (17:38 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 31 Jan 2018 15:17:14 +0000 (15:17 +0000)
commit8aca1410816eb8bca39cd04eaa5f5f32ae727a67
tree8492458a4e006ad061bbfd3fc3196d2c823b806f
parente72f3e59333007d652412f77d0f62254a91803ed
rpc: refactor virNetServer setup for post-exec restarts

With the current code it is neccessary to call

  virNetDaemonNewPostExecRestart()

and then for each server that needs restarting you are supposed
to call

  virNetDaemonAddSeverPostExecRestart()

This is fine if there's only ever one server, but as soon as you
have two servers it is impossible to use this design. The code
has no idea which servers were recorded in the JSON state doc,
nor in which order the hash table serialized its keys.

So this patch changes things so that we only call

  virNetDaemonNewPostExecRestart()

passing in a callback, which is invoked once for each server
found int he JSON state doc.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/libvirt_remote.syms
src/locking/lock_daemon.c
src/logging/log_daemon.c
src/rpc/virnetdaemon.c
src/rpc/virnetdaemon.h
tests/virnetdaemontest.c