[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] build: fix build --without-remote



I tried to test ./configure --without-lxc --without-remote.
First, the build failed with some odd errors, such as an
inability to build xen, or link failures for virNetTLSInit.
But when you think about it, once there is no remote code,
all of libvirtd is useless, any stateful driver that depends
on libvirtd is also not worth compiling, and any libraries
used only by RPC code are not needed.  So I patched
configure.ac to make for some saner defaults when an
explicit disable is attempted.  Similarly, since we have
migrated virnetdevbridge into generic code, the workaround
for Linux kernel stupidity must not depend on stateful
drivers being in use.

Then there's 'make check' that needs segragation.

Wow - quite a bit of cleanup to make --without-remote useful :)

* configure.ac: Let --without-remote toggle defaults on stateful
drivers and other libraries.  Pick up Linux kernel workarounds
even when qemu and lxc are not being compiled.
* tests/Makefile.am (test_programs): Factor out programs that
require remote.
* src/libvirt_private.syms (rpc/virnet*.h): Move...
* src/libvirt_remote.syms: ...into new file.
* src/Makefile.am (SYM_FILES): Ship new syms file.

Signed-off-by: Eric Blake <eblake redhat com>
---

Looks big, but most of it is motion of text from splitting a file.
It fixes a build failure, but --enable-remote is not a regression
for this particular release (it's been broken for a while), so I'll
wait for a review even if it misses 1.1.3.

 configure.ac             |  16 +++-
 src/Makefile.am          |   6 ++
 src/libvirt_private.syms | 199 --------------------------------------------
 src/libvirt_remote.syms  | 210 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/Makefile.am        |  19 +++--
 5 files changed, 243 insertions(+), 207 deletions(-)
 create mode 100644 src/libvirt_remote.syms

diff --git a/configure.ac b/configure.ac
index 553015a..b82dc8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,8 +198,22 @@ fi
 AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
 AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])

+# The daemon requires remote support.  Likewise, if we are not using
+# RPC, we don't need several libraries.
+if test "$with_remote" = "no" ; then
+  with_libvirtd=no
+  with_gnutls=no
+  with_ssh2=no
+  with_sasl=no
+fi
+# Stateful drivers are useful only when building the daemon.
 if test "$with_libvirtd" = "no" ; then
   with_qemu=no
+  with_xen=no
+  with_lxc=no
+  with_libxl=no
+  with_uml=no
+  with_vbox=no
 fi

 # Check for compiler and library settings.
@@ -1053,7 +1067,6 @@ dnl
 dnl check for kernel headers required by src/bridge.c
 dnl
 if test "$with_linux" = "yes"; then
-  if test "$with_qemu" = "yes" || test "$with_lxc" = "yes" ; then
     # Various kernel versions have headers that are not self-standing, but
     # yet are incompatible with the corresponding glibc headers.  In order
     # to guarantee compilation across a wide range of versions (from RHEL 5
@@ -1087,7 +1100,6 @@ if test "$with_linux" = "yes"; then
         #endif
         #include <linux/in6.h>
       ]])
-  fi
 fi


diff --git a/src/Makefile.am b/src/Makefile.am
index 8632b18..201c268 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1756,6 +1756,12 @@ else ! WITH_LIBVIRTD
 SYM_FILES += $(srcdir)/libvirt_daemon.syms
 endif ! WITH_LIBVIRTD

+if WITH_REMOTE
+USED_SYM_FILES += $(srcdir)/libvirt_remote.syms
+else ! WITH_REMOTE
+SYM_FILES += $(srcdir)/libvirt_remote.syms
+endif ! WITH_REMOTE
+
 if WITH_OPENVZ
 USED_SYM_FILES += $(srcdir)/libvirt_openvz.syms
 else ! WITH_OPENVZ
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 48e4b04..62aab9b 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -831,205 +831,6 @@ nodeGetMemoryStats;
 nodeSetMemoryParameters;


-# rpc/virnetclient.h
-virNetClientAddProgram;
-virNetClientAddStream;
-virNetClientClose;
-virNetClientDupFD;
-virNetClientGetFD;
-virNetClientHasPassFD;
-virNetClientIsEncrypted;
-virNetClientIsOpen;
-virNetClientKeepAliveIsSupported;
-virNetClientKeepAliveStart;
-virNetClientKeepAliveStop;
-virNetClientLocalAddrString;
-virNetClientNewExternal;
-virNetClientNewLibSSH2;
-virNetClientNewSSH;
-virNetClientNewTCP;
-virNetClientNewUNIX;
-virNetClientRegisterAsyncIO;
-virNetClientRegisterKeepAlive;
-virNetClientRemoteAddrString;
-virNetClientRemoveStream;
-virNetClientSendNonBlock;
-virNetClientSendNoReply;
-virNetClientSendWithReply;
-virNetClientSendWithReplyStream;
-virNetClientSetCloseCallback;
-
-
-# rpc/virnetclientprogram.h
-virNetClientProgramCall;
-virNetClientProgramDispatch;
-virNetClientProgramGetProgram;
-virNetClientProgramGetVersion;
-virNetClientProgramMatches;
-virNetClientProgramNew;
-
-
-# rpc/virnetclientstream.h
-virNetClientStreamEOF;
-virNetClientStreamEventAddCallback;
-virNetClientStreamEventRemoveCallback;
-virNetClientStreamEventUpdateCallback;
-virNetClientStreamMatches;
-virNetClientStreamNew;
-virNetClientStreamQueuePacket;
-virNetClientStreamRaiseError;
-virNetClientStreamRecvPacket;
-virNetClientStreamSendPacket;
-virNetClientStreamSetError;
-
-
-# rpc/virnetmessage.h
-virNetMessageClear;
-virNetMessageDecodeHeader;
-virNetMessageDecodeLength;
-virNetMessageDecodeNumFDs;
-virNetMessageDecodePayload;
-virNetMessageDupFD;
-virNetMessageEncodeHeader;
-virNetMessageEncodeNumFDs;
-virNetMessageEncodePayload;
-virNetMessageEncodePayloadRaw;
-virNetMessageFree;
-virNetMessageNew;
-virNetMessageQueuePush;
-virNetMessageQueueServe;
-virNetMessageSaveError;
-xdr_virNetMessageError;
-
-
-# rpc/virnetserver.h
-virNetServerAddProgram;
-virNetServerAddService;
-virNetServerAddShutdownInhibition;
-virNetServerAddSignalHandler;
-virNetServerAutoShutdown;
-virNetServerClose;
-virNetServerIsPrivileged;
-virNetServerKeepAliveRequired;
-virNetServerNew;
-virNetServerNewPostExecRestart;
-virNetServerPreExecRestart;
-virNetServerQuit;
-virNetServerRemoveShutdownInhibition;
-virNetServerRun;
-virNetServerUpdateServices;
-
-
-# rpc/virnetserverclient.h
-virNetServerClientAddFilter;
-virNetServerClientClose;
-virNetServerClientDelayedClose;
-virNetServerClientGetAuth;
-virNetServerClientGetFD;
-virNetServerClientGetIdentity;
-virNetServerClientGetPrivateData;
-virNetServerClientGetReadonly;
-virNetServerClientGetSELinuxContext;
-virNetServerClientGetUNIXIdentity;
-virNetServerClientImmediateClose;
-virNetServerClientInit;
-virNetServerClientInitKeepAlive;
-virNetServerClientIsClosed;
-virNetServerClientIsLocal;
-virNetServerClientIsSecure;
-virNetServerClientLocalAddrString;
-virNetServerClientNeedAuth;
-virNetServerClientNew;
-virNetServerClientNewPostExecRestart;
-virNetServerClientPreExecRestart;
-virNetServerClientRemoteAddrString;
-virNetServerClientRemoveFilter;
-virNetServerClientSendMessage;
-virNetServerClientSetAuth;
-virNetServerClientSetCloseHook;
-virNetServerClientSetDispatcher;
-virNetServerClientStartKeepAlive;
-virNetServerClientWantClose;
-
-
-# rpc/virnetservermdns.h
-virNetServerMDNSAddEntry;
-virNetServerMDNSAddGroup;
-virNetServerMDNSEntryFree;
-virNetServerMDNSFree;
-virNetServerMDNSGroupFree;
-virNetServerMDNSNew;
-virNetServerMDNSRemoveEntry;
-virNetServerMDNSRemoveGroup;
-virNetServerMDNSStart;
-virNetServerMDNSStop;
-
-
-# rpc/virnetserverprogram.h
-virNetServerProgramDispatch;
-virNetServerProgramGetID;
-virNetServerProgramGetPriority;
-virNetServerProgramGetVersion;
-virNetServerProgramMatches;
-virNetServerProgramNew;
-virNetServerProgramSendReplyError;
-virNetServerProgramSendStreamData;
-virNetServerProgramSendStreamError;
-virNetServerProgramUnknownError;
-
-
-# rpc/virnetserverservice.h
-virNetServerServiceClose;
-virNetServerServiceGetAuth;
-virNetServerServiceGetMaxRequests;
-virNetServerServiceGetPort;
-virNetServerServiceIsReadonly;
-virNetServerServiceNewFD;
-virNetServerServiceNewPostExecRestart;
-virNetServerServiceNewTCP;
-virNetServerServiceNewUNIX;
-virNetServerServicePreExecRestart;
-virNetServerServiceSetDispatcher;
-virNetServerServiceToggle;
-
-
-# rpc/virnetsocket.h
-virNetSocketAccept;
-virNetSocketAddIOCallback;
-virNetSocketClose;
-virNetSocketDupFD;
-virNetSocketGetFD;
-virNetSocketGetPort;
-virNetSocketGetSELinuxContext;
-virNetSocketGetUNIXIdentity;
-virNetSocketHasCachedData;
-virNetSocketHasPassFD;
-virNetSocketHasPendingData;
-virNetSocketIsLocal;
-virNetSocketListen;
-virNetSocketLocalAddrString;
-virNetSocketNewConnectCommand;
-virNetSocketNewConnectExternal;
-virNetSocketNewConnectLibSSH2;
-virNetSocketNewConnectSockFD;
-virNetSocketNewConnectSSH;
-virNetSocketNewConnectTCP;
-virNetSocketNewConnectUNIX;
-virNetSocketNewListenFD;
-virNetSocketNewListenTCP;
-virNetSocketNewListenUNIX;
-virNetSocketNewPostExecRestart;
-virNetSocketPreExecRestart;
-virNetSocketRead;
-virNetSocketRecvFD;
-virNetSocketRemoteAddrString;
-virNetSocketRemoveIOCallback;
-virNetSocketSendFD;
-virNetSocketSetBlocking;
-virNetSocketUpdateIOCallback;
-virNetSocketWrite;
-
-
 # security/security_driver.h
 virSecurityDriverLookup;

diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
new file mode 100644
index 0000000..d482a55
--- /dev/null
+++ b/src/libvirt_remote.syms
@@ -0,0 +1,210 @@
+#
+# Private symbols used in RPC operations. Add symbols here, and see
+# Makefile.am for more details.
+#
+# Keep this file sorted by header name, then by symbols with each header.
+#
+
+# rpc/virnetclient.h
+virNetClientAddProgram;
+virNetClientAddStream;
+virNetClientClose;
+virNetClientDupFD;
+virNetClientGetFD;
+virNetClientHasPassFD;
+virNetClientIsEncrypted;
+virNetClientIsOpen;
+virNetClientKeepAliveIsSupported;
+virNetClientKeepAliveStart;
+virNetClientKeepAliveStop;
+virNetClientLocalAddrString;
+virNetClientNewExternal;
+virNetClientNewLibSSH2;
+virNetClientNewSSH;
+virNetClientNewTCP;
+virNetClientNewUNIX;
+virNetClientRegisterAsyncIO;
+virNetClientRegisterKeepAlive;
+virNetClientRemoteAddrString;
+virNetClientRemoveStream;
+virNetClientSendNonBlock;
+virNetClientSendNoReply;
+virNetClientSendWithReply;
+virNetClientSendWithReplyStream;
+virNetClientSetCloseCallback;
+
+
+# rpc/virnetclientprogram.h
+virNetClientProgramCall;
+virNetClientProgramDispatch;
+virNetClientProgramGetProgram;
+virNetClientProgramGetVersion;
+virNetClientProgramMatches;
+virNetClientProgramNew;
+
+
+# rpc/virnetclientstream.h
+virNetClientStreamEOF;
+virNetClientStreamEventAddCallback;
+virNetClientStreamEventRemoveCallback;
+virNetClientStreamEventUpdateCallback;
+virNetClientStreamMatches;
+virNetClientStreamNew;
+virNetClientStreamQueuePacket;
+virNetClientStreamRaiseError;
+virNetClientStreamRecvPacket;
+virNetClientStreamSendPacket;
+virNetClientStreamSetError;
+
+
+# rpc/virnetmessage.h
+virNetMessageClear;
+virNetMessageDecodeHeader;
+virNetMessageDecodeLength;
+virNetMessageDecodeNumFDs;
+virNetMessageDecodePayload;
+virNetMessageDupFD;
+virNetMessageEncodeHeader;
+virNetMessageEncodeNumFDs;
+virNetMessageEncodePayload;
+virNetMessageEncodePayloadRaw;
+virNetMessageFree;
+virNetMessageNew;
+virNetMessageQueuePush;
+virNetMessageQueueServe;
+virNetMessageSaveError;
+xdr_virNetMessageError;
+
+
+# rpc/virnetserver.h
+virNetServerAddProgram;
+virNetServerAddService;
+virNetServerAddShutdownInhibition;
+virNetServerAddSignalHandler;
+virNetServerAutoShutdown;
+virNetServerClose;
+virNetServerIsPrivileged;
+virNetServerKeepAliveRequired;
+virNetServerNew;
+virNetServerNewPostExecRestart;
+virNetServerPreExecRestart;
+virNetServerQuit;
+virNetServerRemoveShutdownInhibition;
+virNetServerRun;
+virNetServerUpdateServices;
+
+
+# rpc/virnetserverclient.h
+virNetServerClientAddFilter;
+virNetServerClientClose;
+virNetServerClientDelayedClose;
+virNetServerClientGetAuth;
+virNetServerClientGetFD;
+virNetServerClientGetIdentity;
+virNetServerClientGetPrivateData;
+virNetServerClientGetReadonly;
+virNetServerClientGetSELinuxContext;
+virNetServerClientGetUNIXIdentity;
+virNetServerClientImmediateClose;
+virNetServerClientInit;
+virNetServerClientInitKeepAlive;
+virNetServerClientIsClosed;
+virNetServerClientIsLocal;
+virNetServerClientIsSecure;
+virNetServerClientLocalAddrString;
+virNetServerClientNeedAuth;
+virNetServerClientNew;
+virNetServerClientNewPostExecRestart;
+virNetServerClientPreExecRestart;
+virNetServerClientRemoteAddrString;
+virNetServerClientRemoveFilter;
+virNetServerClientSendMessage;
+virNetServerClientSetAuth;
+virNetServerClientSetCloseHook;
+virNetServerClientSetDispatcher;
+virNetServerClientStartKeepAlive;
+virNetServerClientWantClose;
+
+
+# rpc/virnetservermdns.h
+virNetServerMDNSAddEntry;
+virNetServerMDNSAddGroup;
+virNetServerMDNSEntryFree;
+virNetServerMDNSFree;
+virNetServerMDNSGroupFree;
+virNetServerMDNSNew;
+virNetServerMDNSRemoveEntry;
+virNetServerMDNSRemoveGroup;
+virNetServerMDNSStart;
+virNetServerMDNSStop;
+
+
+# rpc/virnetserverprogram.h
+virNetServerProgramDispatch;
+virNetServerProgramGetID;
+virNetServerProgramGetPriority;
+virNetServerProgramGetVersion;
+virNetServerProgramMatches;
+virNetServerProgramNew;
+virNetServerProgramSendReplyError;
+virNetServerProgramSendStreamData;
+virNetServerProgramSendStreamError;
+virNetServerProgramUnknownError;
+
+
+# rpc/virnetserverservice.h
+virNetServerServiceClose;
+virNetServerServiceGetAuth;
+virNetServerServiceGetMaxRequests;
+virNetServerServiceGetPort;
+virNetServerServiceIsReadonly;
+virNetServerServiceNewFD;
+virNetServerServiceNewPostExecRestart;
+virNetServerServiceNewTCP;
+virNetServerServiceNewUNIX;
+virNetServerServicePreExecRestart;
+virNetServerServiceSetDispatcher;
+virNetServerServiceToggle;
+
+
+# rpc/virnetsocket.h
+virNetSocketAccept;
+virNetSocketAddIOCallback;
+virNetSocketClose;
+virNetSocketDupFD;
+virNetSocketGetFD;
+virNetSocketGetPort;
+virNetSocketGetSELinuxContext;
+virNetSocketGetUNIXIdentity;
+virNetSocketHasCachedData;
+virNetSocketHasPassFD;
+virNetSocketHasPendingData;
+virNetSocketIsLocal;
+virNetSocketListen;
+virNetSocketLocalAddrString;
+virNetSocketNewConnectCommand;
+virNetSocketNewConnectExternal;
+virNetSocketNewConnectLibSSH2;
+virNetSocketNewConnectSockFD;
+virNetSocketNewConnectSSH;
+virNetSocketNewConnectTCP;
+virNetSocketNewConnectUNIX;
+virNetSocketNewListenFD;
+virNetSocketNewListenTCP;
+virNetSocketNewListenUNIX;
+virNetSocketNewPostExecRestart;
+virNetSocketPreExecRestart;
+virNetSocketRead;
+virNetSocketRecvFD;
+virNetSocketRemoteAddrString;
+virNetSocketRemoveIOCallback;
+virNetSocketSendFD;
+virNetSocketSetBlocking;
+virNetSocketUpdateIOCallback;
+virNetSocketWrite;
+
+
+# Let emacs know we want case-insensitive sorting
+# Local Variables:
+# sort-fold-case: t
+# End:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 17a2a72..9a6453b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -114,8 +114,8 @@ test_helpers = commandhelper ssh test_conf
 test_programs = virshtest sockettest \
 	nodeinfotest virbuftest \
 	commandtest seclabeltest \
-	virhashtest virnetmessagetest virnetsockettest \
-	viratomictest virnetserverclienttest \
+	virhashtest \
+	viratomictest \
 	utiltest shunloadtest \
 	virtimetest viruritest virkeyfiletest \
 	virauthconfigtest \
@@ -131,6 +131,17 @@ test_programs = virshtest sockettest \
 	virstoragetest \
 	$(NULL)

+if WITH_REMOTE
+test_programs += \
+	virnetmessagetest \
+	virnetsockettest \
+	virnetserverclienttest \
+	$(NULL)
+if WITH_GNUTLS
+test_programs += virnettlscontexttest virnettlssessiontest
+endif WITH_GNUTLS
+endif WITH_REMOTE
+
 if WITH_LINUX
 test_programs += fchosttest
 endif WITH_LINUX
@@ -144,10 +155,6 @@ test_programs += virdbustest \
                  virsystemdtest
 endif WITH_DBUS

-if WITH_GNUTLS
-test_programs += virnettlscontexttest virnettlssessiontest
-endif WITH_GNUTLS
-
 if WITH_SECDRIVER_SELINUX
 if WITH_ATTR
 test_programs += securityselinuxtest
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]