1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-27 07:22:07 +03:00

rpc: add API for checking whether an auth scheme is in use on a server

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-06-25 17:04:47 +01:00
parent 9692fe10eb
commit 49fa9e64ca
3 changed files with 21 additions and 0 deletions

View File

@ -126,6 +126,7 @@ virNetServerGetMaxUnauthClients;
virNetServerGetName;
virNetServerGetThreadPoolParameters;
virNetServerHasClients;
virNetServerNeedsAuth;
virNetServerNew;
virNetServerNewPostExecRestart;
virNetServerNextClientID;

View File

@ -1098,6 +1098,23 @@ virNetServerGetCurrentUnauthClients(virNetServerPtr srv)
return ret;
}
bool virNetServerNeedsAuth(virNetServerPtr srv,
int auth)
{
bool ret = false;
size_t i;
virObjectLock(srv);
for (i = 0; i < srv->nservices; i++) {
if (virNetServerServiceGetAuth(srv->services[i]) == auth)
ret = true;
}
virObjectUnlock(srv);
return ret;
}
int
virNetServerGetClients(virNetServerPtr srv,
virNetServerClientPtr **clts)

View File

@ -119,6 +119,9 @@ unsigned long long virNetServerNextClientID(virNetServerPtr srv);
virNetServerClientPtr virNetServerGetClient(virNetServerPtr srv,
unsigned long long id);
bool virNetServerNeedsAuth(virNetServerPtr srv,
int auth);
int virNetServerGetClients(virNetServerPtr srv,
virNetServerClientPtr **clients);