提交 49fa9e64 编写于 作者: D Daniel P. Berrangé

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

Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 9692fe10
...@@ -126,6 +126,7 @@ virNetServerGetMaxUnauthClients; ...@@ -126,6 +126,7 @@ virNetServerGetMaxUnauthClients;
virNetServerGetName; virNetServerGetName;
virNetServerGetThreadPoolParameters; virNetServerGetThreadPoolParameters;
virNetServerHasClients; virNetServerHasClients;
virNetServerNeedsAuth;
virNetServerNew; virNetServerNew;
virNetServerNewPostExecRestart; virNetServerNewPostExecRestart;
virNetServerNextClientID; virNetServerNextClientID;
......
...@@ -1098,6 +1098,23 @@ virNetServerGetCurrentUnauthClients(virNetServerPtr srv) ...@@ -1098,6 +1098,23 @@ virNetServerGetCurrentUnauthClients(virNetServerPtr srv)
return ret; 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 int
virNetServerGetClients(virNetServerPtr srv, virNetServerGetClients(virNetServerPtr srv,
virNetServerClientPtr **clts) virNetServerClientPtr **clts)
......
...@@ -119,6 +119,9 @@ unsigned long long virNetServerNextClientID(virNetServerPtr srv); ...@@ -119,6 +119,9 @@ unsigned long long virNetServerNextClientID(virNetServerPtr srv);
virNetServerClientPtr virNetServerGetClient(virNetServerPtr srv, virNetServerClientPtr virNetServerGetClient(virNetServerPtr srv,
unsigned long long id); unsigned long long id);
bool virNetServerNeedsAuth(virNetServerPtr srv,
int auth);
int virNetServerGetClients(virNetServerPtr srv, int virNetServerGetClients(virNetServerPtr srv,
virNetServerClientPtr **clients); virNetServerClientPtr **clients);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册