提交 03fd5105 编写于 作者: D Daniel P. Berrangé

rpc: remove unused API for creating services from FDs

The virNetServerServiceNewFDOrUNIX method cannot be correctly used when
dealing with systemd activation of a service which can receive more than
one socket FD as there is not guaranteed ordering of FDs.
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 e2f012b8
...@@ -205,7 +205,6 @@ virNetServerServiceGetMaxRequests; ...@@ -205,7 +205,6 @@ virNetServerServiceGetMaxRequests;
virNetServerServiceGetPort; virNetServerServiceGetPort;
virNetServerServiceGetTLSContext; virNetServerServiceGetTLSContext;
virNetServerServiceIsReadonly; virNetServerServiceIsReadonly;
virNetServerServiceNewFDOrUNIX;
virNetServerServiceNewFDs; virNetServerServiceNewFDs;
virNetServerServiceNewPostExecRestart; virNetServerServiceNewPostExecRestart;
virNetServerServiceNewTCP; virNetServerServiceNewTCP;
......
...@@ -88,52 +88,6 @@ static void virNetServerServiceAccept(virNetSocketPtr sock, ...@@ -88,52 +88,6 @@ static void virNetServerServiceAccept(virNetSocketPtr sock,
} }
virNetServerServicePtr
virNetServerServiceNewFDOrUNIX(const char *path,
mode_t mask,
gid_t grp,
int auth,
virNetTLSContextPtr tls,
bool readonly,
size_t max_queued_clients,
size_t nrequests_client_max,
unsigned int nfds,
unsigned int *cur_fd)
{
if (*cur_fd - STDERR_FILENO > nfds) {
/*
* There are no more file descriptors to use, so we have to
* fallback to UNIX socket.
*/
return virNetServerServiceNewUNIX(path,
mask,
grp,
auth,
tls,
readonly,
max_queued_clients,
nrequests_client_max);
} else {
int fds[] = {(*cur_fd)++};
/*
* There's still enough file descriptors. In this case we'll
* use the current one and increment it afterwards. Take care
* with order of operation for pointer arithmetic and auto
* increment on cur_fd - the parentheses are necessary.
*/
return virNetServerServiceNewFDs(fds,
ARRAY_CARDINALITY(fds),
false,
auth,
tls,
readonly,
max_queued_clients,
nrequests_client_max);
}
}
static virNetServerServicePtr static virNetServerServicePtr
virNetServerServiceNewSocket(virNetSocketPtr *socks, virNetServerServiceNewSocket(virNetSocketPtr *socks,
size_t nsocks, size_t nsocks,
......
...@@ -34,16 +34,6 @@ typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr svc, ...@@ -34,16 +34,6 @@ typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr svc,
virNetSocketPtr sock, virNetSocketPtr sock,
void *opaque); void *opaque);
virNetServerServicePtr virNetServerServiceNewFDOrUNIX(const char *path,
mode_t mask,
gid_t grp,
int auth,
virNetTLSContextPtr tls,
bool readonly,
size_t max_queued_clients,
size_t nrequests_client_max,
unsigned int nfds,
unsigned int *cur_fd);
virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename,
const char *service, const char *service,
int family, int family,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册