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/rpc/virnetserver.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
src/rpc/virnetserver.h | 5 +++++
2 files changed, 53 insertions(+)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index cf48e50..38d807f 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -877,3 +877,51 @@ virNetServerGetName(virNetServerPtr srv)
{
return srv->name;
}
+
+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 aa24440..770288d 100644
--- a/src/rpc/virnetserver.h
+++ b/src/rpc/virnetserver.h
@@ -89,4 +89,9 @@ int virNetServerStart(virNetServerPtr srv);
const char *virNetServerGetName(virNetServerPtr srv);
+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.4.11