summaryrefslogtreecommitdiff
path: root/src/rpc/virnetserverservice.c
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2013-07-25 14:45:38 +0200
committerMichal Privoznik <mprivozn@redhat.com>2013-08-05 11:03:01 +0200
commit1199edb1d4e3ebbc691bd32d3519a3b662225420 (patch)
treed0a0a882a6aee782d65b1d0107d101838b5db07d /src/rpc/virnetserverservice.c
parent2737aaafe953fc63c3387aa3ecc540b0f44c735c (diff)
downloadlibvirt-1199edb1d4e3ebbc691bd32d3519a3b662225420.tar.gz
Introduce max_queued_clients
This configuration knob lets user to set the length of queue of connection requests waiting to be accept()-ed by the daemon. IOW, it just controls the @backlog passed to listen: int listen(int sockfd, int backlog);
Diffstat (limited to 'src/rpc/virnetserverservice.c')
-rw-r--r--src/rpc/virnetserverservice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index 632f03d39f..4113ec988e 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -97,6 +97,7 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename,
virNetTLSContextPtr tls,
#endif
bool readonly,
+ size_t max_queued_clients,
size_t nrequests_client_max)
{
virNetServerServicePtr svc;
@@ -122,7 +123,7 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename,
goto error;
for (i = 0; i < svc->nsocks; i++) {
- if (virNetSocketListen(svc->socks[i], 0) < 0)
+ if (virNetSocketListen(svc->socks[i], max_queued_clients) < 0)
goto error;
/* IO callback is initially disabled, until we're ready
@@ -155,6 +156,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
virNetTLSContextPtr tls,
#endif
bool readonly,
+ size_t max_queued_clients,
size_t nrequests_client_max)
{
virNetServerServicePtr svc;
@@ -185,7 +187,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
goto error;
for (i = 0; i < svc->nsocks; i++) {
- if (virNetSocketListen(svc->socks[i], 0) < 0)
+ if (virNetSocketListen(svc->socks[i], max_queued_clients) < 0)
goto error;
/* IO callback is initially disabled, until we're ready