Add some trivial getters for client related attributes to virnetserver before
any admin method can be introduced.
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
src/libvirt_remote.syms | 4 ++++
src/rpc/virnetserver.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
src/rpc/virnetserver.h | 5 +++++
3 files changed, 58 insertions(+)
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index 6b098b4..1a88fff 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -103,6 +103,10 @@ virNetServerAddProgram;
virNetServerAddService;
virNetServerClose;
virNetServerGetClients;
+virNetServerGetCurrentClients;
+virNetServerGetCurrentUnauthClients;
+virNetServerGetMaxClients;
+virNetServerGetMaxUnauthClients;
virNetServerGetName;
virNetServerHasClients;
virNetServerNew;
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 60541cb..2cd1765 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -941,6 +941,55 @@ virNetServerSetThreadPoolParameters(virNetServerPtr srv,
ret = virThreadPoolSetParameters(srv->workers, minWorkers,
maxWorkers, prioWorkers);
virObjectUnlock(srv);
+
+ return ret;
+}
+
+size_t
+virNetServerGetMaxClients(virNetServerPtr srv)
+{
+ size_t ret;
+
+ virObjectLock(srv);
+ ret = srv->nclients_max;
+ virObjectUnlock(srv);
+
+ return ret;
+}
+
+size_t
+virNetServerGetCurrentClients(virNetServerPtr srv)
+{
+ size_t ret;
+
+ virObjectLock(srv);
+ ret = srv->nclients;
+ virObjectUnlock(srv);
+
+ return ret;
+}
+
+size_t
+virNetServerGetMaxUnauthClients(virNetServerPtr srv)
+{
+ size_t ret;
+
+ virObjectLock(srv);
+ ret = srv->nclients_unauth_max;
+ virObjectUnlock(srv);
+
+ return ret;
+}
+
+size_t
+virNetServerGetCurrentUnauthClients(virNetServerPtr srv)
+{
+ size_t ret;
+
+ virObjectLock(srv);
+ ret = srv->nclients_unauth;
+ virObjectUnlock(srv);
+
return ret;
}
diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h
index 993bda7..a08cab0 100644
--- a/src/rpc/virnetserver.h
+++ b/src/rpc/virnetserver.h
@@ -111,4 +111,9 @@ virNetServerClientPtr virNetServerGetClient(virNetServerPtr srv,
int virNetServerGetClients(virNetServerPtr srv,
virNetServerClientPtr **clients);
+size_t virNetServerGetMaxClients(virNetServerPtr srv);
+size_t virNetServerGetCurrentClients(virNetServerPtr srv);
+size_t virNetServerGetMaxUnauthClients(virNetServerPtr srv);
+size_t virNetServerGetCurrentUnauthClients(virNetServerPtr srv);
+
#endif /* __VIR_NET_SERVER_H__ */
--
2.5.5