[PATCH 3/7] 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 | 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

--
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]