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:
parent
9692fe10eb
commit
49fa9e64ca
@ -126,6 +126,7 @@ virNetServerGetMaxUnauthClients;
|
||||
virNetServerGetName;
|
||||
virNetServerGetThreadPoolParameters;
|
||||
virNetServerHasClients;
|
||||
virNetServerNeedsAuth;
|
||||
virNetServerNew;
|
||||
virNetServerNewPostExecRestart;
|
||||
virNetServerNextClientID;
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user