提交 6bda9f8a 编写于 作者: M Martin Kletzander

rpc: Add virNetServerGetNClients

This function accesses the number of connected clients while properly
locking the server it returns the data about.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 d5f4241b
......@@ -99,6 +99,7 @@ virNetServerAddClient;
virNetServerAddProgram;
virNetServerAddService;
virNetServerClose;
virNetServerGetNClients;
virNetServerHasClients;
virNetServerKeepAliveRequired;
virNetServerNew;
......
......@@ -884,3 +884,13 @@ virNetServerStart(virNetServerPtr srv)
return virNetServerMDNSStart(srv->mdns);
}
size_t
virNetServerGetNClients(virNetServerPtr srv)
{
size_t ret = 0;
virObjectLock(srv);
ret = srv->nclients;
virObjectUnlock(srv);
return ret;
}
......@@ -90,4 +90,6 @@ void virNetServerUpdateServices(virNetServerPtr srv, bool enabled);
int virNetServerStart(virNetServerPtr srv);
size_t virNetServerGetNClients(virNetServerPtr srv);
#endif /* __VIR_NET_SERVER_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册