Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libvirt_remote.syms | 1 +
src/rpc/virnetserver.c | 17 +++++++++++++++++
src/rpc/virnetserver.h | 3 +++
3 files changed, 21 insertions(+)
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index d855078186..386137c0d8 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -126,6 +126,7 @@ virNetServerGetMaxUnauthClients;
virNetServerGetName;
virNetServerGetThreadPoolParameters;
virNetServerHasClients;
+virNetServerNeedsAuth;
virNetServerNew;
virNetServerNewPostExecRestart;
virNetServerNextClientID;
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 894feae406..e229f57bab 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -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)
diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h
index 1b4184733f..260c99b22d 100644
--- a/src/rpc/virnetserver.h
+++ b/src/rpc/virnetserver.h
@@ -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);
--
2.21.0