mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 11:01:19 +00:00
rpc: Add virNetDaemonHasClients
So callers don't have to iterate over each server. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
780fe4e4ba
commit
699faeacb1
@ -65,6 +65,7 @@ virNetDaemonAddSignalHandler;
|
||||
virNetDaemonAutoShutdown;
|
||||
virNetDaemonClose;
|
||||
virNetDaemonGetServer;
|
||||
virNetDaemonHasClients;
|
||||
virNetDaemonIsPrivileged;
|
||||
virNetDaemonNew;
|
||||
virNetDaemonNewPostExecRestart;
|
||||
|
@ -747,3 +747,16 @@ virNetDaemonClose(virNetDaemonPtr dmn)
|
||||
|
||||
virObjectUnlock(dmn);
|
||||
}
|
||||
|
||||
bool
|
||||
virNetDaemonHasClients(virNetDaemonPtr dmn)
|
||||
{
|
||||
size_t i = 0;
|
||||
|
||||
for (i = 0; i < dmn->nservers; i++) {
|
||||
if (virNetServerHasClients(dmn->servers[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -76,6 +76,8 @@ void virNetDaemonQuit(virNetDaemonPtr dmn);
|
||||
|
||||
void virNetDaemonClose(virNetDaemonPtr dmn);
|
||||
|
||||
bool virNetDaemonHasClients(virNetDaemonPtr dmn);
|
||||
|
||||
virNetServerPtr virNetDaemonGetServer(virNetDaemonPtr dmn,
|
||||
int subServerID);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user