1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

rpc: add shutdown facilities to netserver

virNetServerClose and virNetServerShutdownWait are used to start net server
threads shutdown and wait net server threads to actually finish respectively
during net daemon shutdown procedure.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Nikolay Shirokovskiy 2020-07-23 09:50:25 +03:00
parent 0f38dedd89
commit b776dfa8e8
2 changed files with 9 additions and 0 deletions

View File

@ -942,9 +942,17 @@ void virNetServerClose(virNetServerPtr srv)
for (i = 0; i < srv->nclients; i++)
virNetServerClientClose(srv->clients[i]);
virThreadPoolStop(srv->workers);
virObjectUnlock(srv);
}
void
virNetServerShutdownWait(virNetServerPtr srv)
{
virThreadPoolDrain(srv->workers);
}
static inline size_t
virNetServerTrackPendingAuthLocked(virNetServerPtr srv)
{

View File

@ -56,6 +56,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6);
void virNetServerClose(virNetServerPtr srv);
void virNetServerShutdownWait(virNetServerPtr srv);
virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv);