[PATCH REPOST 1/5] virnetserver: Introduce client processing controls getters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add some trivial getters for client related attributes to virnetserver before
any admin method can be introduced.

Signed-off-by: Erik Skultety <eskultet@xxxxxxxxxx>
---
 src/rpc/virnetserver.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/rpc/virnetserver.h |  5 +++++
 2 files changed, 54 insertions(+)

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]