From: "Daniel P. Berrange" <berra...@redhat.com>

The libvirt_test.la library was introduced to allow test suites
to reference internal-only symbols. These days, nearly every
symbol we care about is in src/libvirt_private.syms, so there
is no need for libvirt_test.la to continue to exist

* src/Makefile.am: Delete libvirt_test.la & add new .syms files
* src/libvirt_private.syms: Export symbols needed by test suite
* tests/Makefile.am: Link to libvirt_test.la. Ensure LXC tests link
  to network_driver.la
* src/libvirt_esx.syms, src/libvirt_openvz.syms: Add exports neede
  by test suite

Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
---
 src/Makefile.am          |   28 +++++----------
 src/libvirt_esx.syms     |    7 ++++
 src/libvirt_openvz.syms  |    7 ++++
 src/libvirt_private.syms |   41 +++++++++++++++++++++-
 tests/Makefile.am        |   86 ++++++++++++++++++++++++----------------------
 5 files changed, 109 insertions(+), 60 deletions(-)
 create mode 100644 src/libvirt_esx.syms
 create mode 100644 src/libvirt_openvz.syms

diff --git a/src/Makefile.am b/src/Makefile.am
index 999a48a..b677492 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1133,6 +1133,10 @@ if HAVE_DBUS
 USED_SYM_FILES += libvirt_dbus.syms
 endif
 
+if WITH_ESX
+USED_SYM_FILES += libvirt_esx.syms
+endif
+
 if WITH_LIBVIRTD
 USED_SYM_FILES += libvirt_daemon.syms
 endif
@@ -1141,6 +1145,10 @@ if WITH_NWFILTER
 USED_SYM_FILES += libvirt_nwfilter.syms
 endif
 
+if WITH_OPENVZ
+USED_SYM_FILES += libvirt_openvz.syms
+endif
+
 if WITH_VMX
 USED_SYM_FILES += libvirt_vmx.syms
 endif
@@ -1164,8 +1172,10 @@ EXTRA_DIST += \
   libvirt_daemon.syms          \
   libvirt_linux.syms           \
   libvirt_dbus.syms            \
+  libvirt_esx.syms             \
   libvirt_network.syms         \
   libvirt_nwfilter.syms                \
+  libvirt_openvz.syms          \
   libvirt_sasl.syms            \
   libvirt_vmx.syms             \
   libvirt_xenxs.syms
@@ -1256,24 +1266,6 @@ endif
 
 EXTRA_DIST += probes.d
 
-
-# Create an automake "convenience library" version of libvirt_la,
-# just for testing, since the test harness requires access to internal
-# bits and pieces that we don't want to make publicly accessible.
-noinst_LTLIBRARIES += libvirt_test.la
-
-# Remove version script from convenience library
-test_LDFLAGS =                                         \
-  $$(echo '$(libvirt_la_LDFLAGS)'                      \
-     |sed 's!$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_SYMBOL_FILE)!!'  \
-     |sed 's!-version-info $(LIBVIRT_VERSION_INFO)!!')
-
-# Just like the above, but with a slightly different set of public symbols.
-libvirt_test_la_SOURCES = $(libvirt_la_SOURCES)
-libvirt_test_la_LIBADD = $(libvirt_la_LIBADD)
-libvirt_test_la_LDFLAGS = $(test_LDFLAGS) $(AM_LDFLAGS)
-libvirt_test_la_CFLAGS = $(AM_CFLAGS)
-
 libvirt_qemu_la_SOURCES = libvirt-qemu.c
 libvirt_qemu_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
                          -version-info $(LIBVIRT_VERSION_INFO) \
diff --git a/src/libvirt_esx.syms b/src/libvirt_esx.syms
new file mode 100644
index 0000000..163f248
--- /dev/null
+++ b/src/libvirt_esx.syms
@@ -0,0 +1,7 @@
+#
+# These symbols are dependent upon --with-openvz via WITH_OPENVZ
+#
+
+esxUtil_EscapeDatastoreItem;
+esxVI_DateTime_ConvertToCalendarTime;
+esxUtil_ParseDatastorePath;
diff --git a/src/libvirt_openvz.syms b/src/libvirt_openvz.syms
new file mode 100644
index 0000000..11c5587
--- /dev/null
+++ b/src/libvirt_openvz.syms
@@ -0,0 +1,7 @@
+#
+# These symbols are dependent upon --with-openvz via WITH_OPENVZ
+#
+
+openvzReadConfigParam;
+openvzReadNetworkConf;
+openvzLocateConfFile;
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 97fec2f..cad870a 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -189,6 +189,7 @@ virCPUModeTypeToString;
 
 
 # datatypes.h
+virGetConnect;
 virGetDomain;
 virGetDomainSnapshot;
 virGetInterface;
@@ -428,6 +429,8 @@ virDomainRunningReasonTypeToString;
 virDomainSaveConfig;
 virDomainSaveStatus;
 virDomainSaveXML;
+virDomainSeclabelTypeFromString;
+virDomainSeclabelTypeToString;
 virDomainShutdownReasonTypeFromString;
 virDomainShutdownReasonTypeToString;
 virDomainShutoffReasonTypeFromString;
@@ -436,6 +439,8 @@ virDomainSmartcardDefForeach;
 virDomainSmartcardDefFree;
 virDomainSmartcardTypeFromString;
 virDomainSmartcardTypeToString;
+virDomainSmbiosModeTypeFromString;
+virDomainSmbiosModeTypeToString;
 virDomainSnapshotAlignDisks;
 virDomainSnapshotAssignDef;
 virDomainSnapshotDefFormat;
@@ -559,8 +564,16 @@ ebtablesRemoveForwardAllowIn;
 
 
 # event_poll.h
-virEventPollToNativeEvents;
+virEventPollAddHandle;
+virEventPollAddTimeout;
 virEventPollFromNativeEvents;
+virEventPollInit;
+virEventPollRemoveHandle;
+virEventPollRemoveTimeout;
+virEventPollRunOnce;
+virEventPollToNativeEvents;
+virEventPollUpdateHandle;
+virEventPollUpdateTimeout;
 
 
 # fdstream.h
@@ -573,6 +586,7 @@ virFDStreamCreateFile;
 # hash.h
 virHashAddEntry;
 virHashCreate;
+virHashEqual;
 virHashForEach;
 virHashFree;
 virHashGetItems;
@@ -782,6 +796,7 @@ virNetworkObjIsDuplicate;
 virNetworkObjListFree;
 virNetworkObjLock;
 virNetworkObjUnlock;
+virNetworkObjFree;
 virNetworkRemoveInactive;
 virNetworkSaveConfig;
 virNetworkSetBridgeMacAddr;
@@ -810,6 +825,7 @@ virNodeDeviceObjUnlock;
 
 
 # nodeinfo.h
+linuxNodeInfoCPUPopulate;
 nodeCapsInitNUMA;
 nodeGetCPUmap;
 nodeGetCPUStats;
@@ -1061,6 +1077,7 @@ virMutexUnlock;
 virOnce;
 virThreadCreate;
 virThreadID;
+virThreadInitialize;
 virThreadIsSelf;
 virThreadJoin;
 virThreadSelf;
@@ -1326,16 +1343,21 @@ virNetlinkEventServiceStart;
 
 # virnetmessage.h
 virNetMessageClear;
+virNetMessageDecodeHeader;
 virNetMessageDecodeNumFDs;
+virNetMessageDecodeLength;
+virNetMessageDecodePayload;
 virNetMessageDupFD;
 virNetMessageEncodeHeader;
 virNetMessageEncodePayload;
+virNetMessageEncodePayloadRaw;
 virNetMessageEncodeNumFDs;
 virNetMessageFree;
 virNetMessageNew;
 virNetMessageQueuePush;
 virNetMessageQueueServe;
 virNetMessageSaveError;
+xdr_virNetMessageError;
 
 
 # virnetserver.h
@@ -1395,22 +1417,38 @@ virNetServerProgramSendStreamError;
 
 
 # virnetsocket.h
+virNetSocketAccept;
 virNetSocketDupFD;
 virNetSocketFree;
 virNetSocketGetFD;
 virNetSocketHasPassFD;
 virNetSocketIsLocal;
 virNetSocketListen;
+virNetSocketLocalAddrString;
+virNetSocketNewConnectCommand;
+virNetSocketNewConnectSSH;
 virNetSocketNewConnectTCP;
+virNetSocketNewConnectUNIX;
+virNetSocketNewListenTCP;
 virNetSocketNewListenUNIX;
+virNetSocketRead;
 virNetSocketRecvFD;
+virNetSocketRemoteAddrString;
 virNetSocketSendFD;
+virNetSocketSetBlocking;
+virNetSocketWrite;
 
 
 # virnettlscontext.h
+virNetTLSContextCheckCertificate;
 virNetTLSContextFree;
+virNetTLSContextNewClient;
 virNetTLSContextNewServer;
 virNetTLSContextNewServerPath;
+virNetTLSSessionFree;
+virNetTLSSessionHandshake;
+virNetTLSSessionNew;
+virNetTLSSessionSetIOCallbacks;
 
 
 # virnodesuspend.h
@@ -1461,6 +1499,7 @@ virSocketAddrSetPort;
 
 # virterror_internal.h
 virDispatchError;
+virErrorInitialize;
 virRaiseErrorFull;
 virReportErrorHelper;
 virReportOOMErrorFull;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dd8bf4f..adeb803 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,19 +34,9 @@ PROBES_O += ../src/probes.o
 endif
 
 LDADDS = \
-       $(STATIC_BINARIES) \
-       $(LIBXML_LIBS) \
-        $(GNUTLS_LIBS) \
-        $(SASL_LIBS) \
-        $(SELINUX_LIBS) \
-        $(APPARMOR_LIBS) \
-        $(YAJL_LIBS) \
         $(WARN_CFLAGS) \
-       ../src/libvirt_test.la \
-       $(PROBES_O) \
-       ../gnulib/lib/libgnu.la \
-       $(LIBSOCKET) \
-        $(COVERAGE_LDFLAGS)
+       ../src/libvirt.la \
+       ../gnulib/lib/libgnu.la
 
 EXTRA_DIST =           \
        capabilityschemadata \
@@ -253,27 +243,32 @@ valgrind:
 sockettest_SOURCES = \
        sockettest.c \
        testutils.c testutils.h
-sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)
+sockettest_LDADD = $(LDADDS)
 
 if WITH_XEN
+xen_LDADDS = $(LDADDS)
+if WITH_DRIVER_MODULES
+xen_LDADDS += ../src/libvirt_driver_xen.la
+endif
+
 xml2sexprtest_SOURCES = \
        xml2sexprtest.c testutilsxen.c testutilsxen.h \
        testutils.c testutils.h
-xml2sexprtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+xml2sexprtest_LDADD = $(xen_LDADDS)
 
 sexpr2xmltest_SOURCES = \
        sexpr2xmltest.c testutilsxen.c testutilsxen.h \
        testutils.c testutils.h
-sexpr2xmltest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+sexpr2xmltest_LDADD = $(xen_LDADDS)
 
 xmconfigtest_SOURCES = \
        xmconfigtest.c testutilsxen.c testutilsxen.h \
        testutils.c testutils.h
-xmconfigtest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+xmconfigtest_LDADD = $(xen_LDADDS)
 
 xencapstest_SOURCES = \
        xencapstest.c testutils.h testutils.c
-xencapstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+xencapstest_LDADD = $(xen_LDADDS)
 
 reconnect_SOURCES = \
        reconnect.c testutils.h testutils.c
@@ -281,7 +276,7 @@ reconnect_LDADD = $(LDADDS)
 
 statstest_SOURCES = \
        statstest.c testutils.h testutils.c
-statstest_LDADD = ../src/libvirt_driver_xen.la $(LDADDS)
+statstest_LDADD = $(xen_LDADDS)
 
 else
 EXTRA_DIST += xml2sexprtest.c sexpr2xmltest.c xmconfigtest.c \
@@ -291,42 +286,44 @@ endif
 
 if WITH_QEMU
 
-qemu_LDADDS = ../src/libvirt_driver_qemu.la
-
+qemu_LDADDS = $(LDADDS)
+if WITH_DRIVER_MODULES
+qemu_LDADDS += ../src/libvirt_driver_qemu.la
 if WITH_NETWORK
 qemu_LDADDS += ../src/libvirt_driver_network.la
 endif
+endif
 
 qemuxml2argvtest_SOURCES = \
        qemuxml2argvtest.c testutilsqemu.c testutilsqemu.h \
        testutils.c testutils.h
-qemuxml2argvtest_LDADD = $(qemu_LDADDS)  $(LDADDS)
+qemuxml2argvtest_LDADD = $(qemu_LDADDS)
 
 qemuxml2xmltest_SOURCES = \
        qemuxml2xmltest.c testutilsqemu.c testutilsqemu.h \
        testutils.c testutils.h
-qemuxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
+qemuxml2xmltest_LDADD = $(qemu_LDADDS)
 
 qemuxmlnstest_SOURCES = \
        qemuxmlnstest.c testutilsqemu.c testutilsqemu.h \
        testutils.c testutils.h
-qemuxmlnstest_LDADD = $(qemu_LDADDS)  $(LDADDS)
+qemuxmlnstest_LDADD = $(qemu_LDADDS)
 
 qemuargv2xmltest_SOURCES = \
        qemuargv2xmltest.c testutilsqemu.c testutilsqemu.h \
        testutils.c testutils.h
-qemuargv2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
+qemuargv2xmltest_LDADD = $(qemu_LDADDS)
 
 qemuhelptest_SOURCES = qemuhelptest.c testutils.c testutils.h
-qemuhelptest_LDADD = $(qemu_LDADDS) $(LDADDS)
+qemuhelptest_LDADD = $(qemu_LDADDS)
 
 qemumonitortest_SOURCES = qemumonitortest.c testutils.c testutils.h
-qemumonitortest_LDADD = $(qemu_LDADDS) $(LDADDS)
+qemumonitortest_LDADD = $(qemu_LDADDS)
 
 domainsnapshotxml2xmltest_SOURCES = \
        domainsnapshotxml2xmltest.c testutilsqemu.c testutilsqemu.h \
        testutils.c testutils.h
-domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS) $(LDADDS)
+domainsnapshotxml2xmltest_LDADD = $(qemu_LDADDS)
 else
 EXTRA_DIST += qemuxml2argvtest.c qemuxml2xmltest.c qemuargv2xmltest.c \
        qemuxmlnstest.c qemuhelptest.c domainsnapshotxml2xmltest.c \
@@ -335,12 +332,18 @@ endif
 
 if WITH_LXC
 
-lxc_LDADDS = ../src/libvirt_driver_lxc.la
+lxc_LDADDS = $(LDADDS)
+if WITH_DRIVER_MODULES
+lxc_LDADDS += ../src/libvirt_driver_lxc.la
+if WITH_NETWORK
+lxc_LDADDS += ../src/libvirt_driver_network.la
+endif
+endif
 
 lxcxml2xmltest_SOURCES = \
        lxcxml2xmltest.c testutilslxc.c testutilslxc.h \
        testutils.c testutils.h
-lxcxml2xmltest_LDADD = $(lxc_LDADDS) $(LDADDS)
+lxcxml2xmltest_LDADD = $(lxc_LDADDS)
 else
 EXTRA_DIST += lxcxml2xmltest.c testutilslxc.c testutilslxc.h
 endif
@@ -349,7 +352,7 @@ if WITH_OPENVZ
 openvzutilstest_SOURCES = \
        openvzutilstest.c \
        testutils.c testutils.h
-openvzutilstest_LDADD = ../src/libvirt_driver_openvz.la $(LDADDS)
+openvzutilstest_LDADD = $(LDADDS)
 else
 EXTRA_DIST += openvzutilstest.c
 endif
@@ -359,7 +362,7 @@ if WITH_ESX
 esxutilstest_SOURCES = \
        esxutilstest.c \
        testutils.c testutils.h
-esxutilstest_LDADD = ../src/libvirt_driver_esx.la $(LDADDS)
+esxutilstest_LDADD = $(LDADDS)
 else
 EXTRA_DIST += esxutilstest.c
 endif
@@ -368,12 +371,12 @@ if WITH_VMX
 vmx2xmltest_SOURCES = \
        vmx2xmltest.c \
        testutils.c testutils.h
-vmx2xmltest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
+vmx2xmltest_LDADD = $(LDADDS)
 
 xml2vmxtest_SOURCES = \
        xml2vmxtest.c \
        testutils.c testutils.h
-xml2vmxtest_LDADD = ../src/libvirt_vmx.la $(LDADDS)
+xml2vmxtest_LDADD = $(LDADDS)
 else
 EXTRA_DIST += vmx2xmltest.c xml2vmxtest.c
 endif
@@ -444,21 +447,22 @@ commandhelper_SOURCES = \
        commandhelper.c
 commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
 commandhelper_LDADD = $(LDADDS)
+commandhelper_LDFLAGS = -static
 
 virnetmessagetest_SOURCES = \
        virnetmessagetest.c testutils.h testutils.c
 virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virnetmessagetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virnetmessagetest_LDADD = $(LDADDS)
 
 virnetsockettest_SOURCES = \
        virnetsockettest.c testutils.h testutils.c
 virnetsockettest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virnetsockettest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virnetsockettest_LDADD = $(LDADDS)
 
 virnettlscontexttest_SOURCES = \
        virnettlscontexttest.c testutils.h testutils.c
 virnettlscontexttest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virnettlscontexttest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virnettlscontexttest_LDADD = $(LDADDS)
 if HAVE_LIBTASN1
 virnettlscontexttest_SOURCES += pkix_asn1_tab.c
 virnettlscontexttest_LDADD += -ltasn1
@@ -469,26 +473,26 @@ endif
 virtimetest_SOURCES = \
        virtimetest.c testutils.h testutils.c
 virtimetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virtimetest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virtimetest_LDADD = $(LDADDS)
 
 viruritest_SOURCES = \
        viruritest.c testutils.h testutils.c
 viruritest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-viruritest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+viruritest_LDADD = $(LDADDS)
 
 virkeyfiletest_SOURCES = \
        virkeyfiletest.c testutils.h testutils.c
 virkeyfiletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virkeyfiletest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virkeyfiletest_LDADD = $(LDADDS)
 
 virauthconfigtest_SOURCES = \
        virauthconfigtest.c testutils.h testutils.c
 virauthconfigtest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS)
-virauthconfigtest_LDADD = ../src/libvirt-net-rpc.la $(LDADDS)
+virauthconfigtest_LDADD = $(LDADDS)
 
 seclabeltest_SOURCES = \
        seclabeltest.c
-seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
+seclabeltest_LDADD = $(LDADDS)
 
 virbuftest_SOURCES = \
        virbuftest.c testutils.h testutils.c
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to