mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
rpc: Add virNetServerGetNClients
This function accesses the number of connected clients while properly locking the server it returns the data about. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
d5f4241bbc
commit
6bda9f8aa2
@ -99,6 +99,7 @@ virNetServerAddClient;
|
|||||||
virNetServerAddProgram;
|
virNetServerAddProgram;
|
||||||
virNetServerAddService;
|
virNetServerAddService;
|
||||||
virNetServerClose;
|
virNetServerClose;
|
||||||
|
virNetServerGetNClients;
|
||||||
virNetServerHasClients;
|
virNetServerHasClients;
|
||||||
virNetServerKeepAliveRequired;
|
virNetServerKeepAliveRequired;
|
||||||
virNetServerNew;
|
virNetServerNew;
|
||||||
|
@ -884,3 +884,13 @@ virNetServerStart(virNetServerPtr srv)
|
|||||||
|
|
||||||
return virNetServerMDNSStart(srv->mdns);
|
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);
|
int virNetServerStart(virNetServerPtr srv);
|
||||||
|
|
||||||
|
size_t virNetServerGetNClients(virNetServerPtr srv);
|
||||||
|
|
||||||
#endif /* __VIR_NET_SERVER_H__ */
|
#endif /* __VIR_NET_SERVER_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user