On Mon, Jul 29, 2019 at 06:10:52PM +0100, Daniel P. Berrangé wrote:
Prepare for reusing libvirtd source to create other daemons by making
the use of IP sockets conditionally defined by the make rules.
The main libvirtd daemon will retain IP listen ability, but all the
driver specific daemons will be local UNIX sockets only. Apps needing
IP connectivity will connect via the libvirtd daemon which will proxy
to the driver specfic daemon.
Reviewed-by: Andrea Bolognani <abologna(a)redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/remote/Makefile.inc.am | 1 +
src/remote/remote_daemon.c | 39 ++++++++++++++++++++++++++-----
src/remote/remote_daemon_config.c | 36 ++++++++++++++++++++--------
src/remote/remote_daemon_config.h | 10 +++++++-
4 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index b72186109a..2277bf49d2 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -148,6 +148,7 @@ libvirtd_CFLAGS = \
-I$(srcdir)/rpc \
-DSOCK_PREFIX="\"libvirt\"" \
-DDAEMON_NAME="\"libvirtd\"" \
+ -DENABLE_IP \
$(NULL)
libvirtd_LDFLAGS = \
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index 97621884b0..fadfc7c016 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -892,7 +900,9 @@ daemonUsage(const char *argv0, bool privileged)
{ "-h | --help", N_("Display program help") },
{ "-v | --verbose", N_("Verbose messages") },
{ "-d | --daemon", N_("Run as a daemon & write PID file")
},
+#ifdef ENABLE_IP
{ "-l | --listen", N_("Listen for TCP/IP connections") },
+#endif /* ENABLE_IP */
{ "-t | --timeout <secs>", N_("Exit after timeout
period") },
{ "-f | --config <file>", N_("Configuration file") },
{ "-V | --version", N_("Display version information") },
@@ -929,6 +939,7 @@ daemonUsage(const char *argv0, bool privileged)
LOCALSTATEDIR, SOCK_PREFIX);
fprintf(stderr, "\n");
+#ifdef ENABLE_IP
fprintf(stderr, " %s:\n", _("TLS"));
fprintf(stderr, " %s: %s\n",
_("CA certificate"),
@@ -940,6 +951,7 @@ daemonUsage(const char *argv0, bool privileged)
_("Server private key"),
privileged ? LIBVIRT_SERVERKEY :
"$HOME/.pki/libvirt/serverkey.pem");
fprintf(stderr, "\n");
+#endif /* ENABLE_IP */
These two use /* ENABLE_IP */ instead of /* ! ENABLE_IP */
Jano