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.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libvirt_remote.syms | 1 -
src/rpc/virnetserverservice.c | 46 -----------------------------------
src/rpc/virnetserverservice.h | 10 --------
3 files changed, 57 deletions(-)
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index f4a62491e5..3307d74324 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -206,7 +206,6 @@ virNetServerServiceGetPort;
virNetServerServiceGetTLSContext;
virNetServerServiceIsReadonly;
virNetServerServiceNewFDs;
-virNetServerServiceNewFDOrUNIX;
virNetServerServiceNewPostExecRestart;
virNetServerServiceNewTCP;
virNetServerServiceNewUNIX;
diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c
index d5df5d5c20..66af27d9f7 100644
--- a/src/rpc/virnetserverservice.c
+++ b/src/rpc/virnetserverservice.c
@@ -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
virNetServerServiceNewSocket(virNetSocketPtr *socks,
size_t nsocks,
diff --git a/src/rpc/virnetserverservice.h b/src/rpc/virnetserverservice.h
index 73d61dde99..d58fc43437 100644
--- a/src/rpc/virnetserverservice.h
+++ b/src/rpc/virnetserverservice.h
@@ -34,16 +34,6 @@ typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr
svc,
virNetSocketPtr sock,
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,
const char *service,
int family,
--
2.21.0