From: "Daniel P. Berrange" <berrange(a)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
---
configure.ac | 1 +
src/Makefile.am | 33 +++++++++-----------
src/libvirt_esx.syms | 7 ++++
src/libvirt_openvz.syms | 7 ++++
src/libvirt_private.syms | 41 ++++++++++++++++++++++++-
tests/Makefile.am | 75 ++++++++++++++++++++++-----------------------
6 files changed, 107 insertions(+), 57 deletions(-)
create mode 100644 src/libvirt_esx.syms
create mode 100644 src/libvirt_openvz.syms
diff --git a/configure.ac b/configure.ac
index 06c6a4b..741a339 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1128,6 +1128,7 @@ if test "$with_dbus" = "yes" ; then
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
+AM_CONDITIONAL([HAVE_DBUS], [test "$have_dbus" = "yes"])
dnl PolicyKit library
diff --git a/src/Makefile.am b/src/Makefile.am
index d15ae89..ef62e2b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1145,6 +1145,14 @@ if WITH_LINUX
USED_SYM_FILES += libvirt_linux.syms
endif
+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
@@ -1153,6 +1161,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
@@ -1175,8 +1187,11 @@ EXTRA_DIST += \
libvirt_driver_modules.syms \
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
@@ -1267,24 +1282,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 6c907c4..0365110 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -189,6 +189,7 @@ virCPUModeTypeToString;
# datatypes.h
+virGetConnect;
virGetDomain;
virGetDomainSnapshot;
virGetInterface;
@@ -431,6 +432,8 @@ virDomainRunningReasonTypeToString;
virDomainSaveConfig;
virDomainSaveStatus;
virDomainSaveXML;
+virDomainSeclabelTypeFromString;
+virDomainSeclabelTypeToString;
virDomainShutdownReasonTypeFromString;
virDomainShutdownReasonTypeToString;
virDomainShutoffReasonTypeFromString;
@@ -439,6 +442,8 @@ virDomainSmartcardDefForeach;
virDomainSmartcardDefFree;
virDomainSmartcardTypeFromString;
virDomainSmartcardTypeToString;
+virDomainSmbiosModeTypeFromString;
+virDomainSmbiosModeTypeToString;
virDomainSnapshotAlignDisks;
virDomainSnapshotAssignDef;
virDomainSnapshotDefFormat;
@@ -561,8 +566,16 @@ ebtablesRemoveForwardAllowIn;
# event_poll.h
-virEventPollToNativeEvents;
+virEventPollAddHandle;
+virEventPollAddTimeout;
virEventPollFromNativeEvents;
+virEventPollInit;
+virEventPollRemoveHandle;
+virEventPollRemoveTimeout;
+virEventPollRunOnce;
+virEventPollToNativeEvents;
+virEventPollUpdateHandle;
+virEventPollUpdateTimeout;
# fdstream.h
@@ -575,6 +588,7 @@ virFDStreamCreateFile;
# hash.h
virHashAddEntry;
virHashCreate;
+virHashEqual;
virHashForEach;
virHashFree;
virHashGetItems;
@@ -788,6 +802,7 @@ virNetworkObjIsDuplicate;
virNetworkObjListFree;
virNetworkObjLock;
virNetworkObjUnlock;
+virNetworkObjFree;
virNetworkRemoveInactive;
virNetworkSaveConfig;
virNetworkSetBridgeMacAddr;
@@ -816,6 +831,7 @@ virNodeDeviceObjUnlock;
# nodeinfo.h
+linuxNodeInfoCPUPopulate;
nodeCapsInitNUMA;
nodeGetCPUmap;
nodeGetCPUStats;
@@ -1068,6 +1084,7 @@ virMutexUnlock;
virOnce;
virThreadCreate;
virThreadID;
+virThreadInitialize;
virThreadIsSelf;
virThreadJoin;
virThreadSelf;
@@ -1348,16 +1365,21 @@ virNetlinkStartup;
# virnetmessage.h
virNetMessageClear;
+virNetMessageDecodeHeader;
virNetMessageDecodeNumFDs;
+virNetMessageDecodeLength;
+virNetMessageDecodePayload;
virNetMessageDupFD;
virNetMessageEncodeHeader;
virNetMessageEncodePayload;
+virNetMessageEncodePayloadRaw;
virNetMessageEncodeNumFDs;
virNetMessageFree;
virNetMessageNew;
virNetMessageQueuePush;
virNetMessageQueueServe;
virNetMessageSaveError;
+xdr_virNetMessageError;
# virnetserver.h
@@ -1417,22 +1439,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
@@ -1485,6 +1523,7 @@ virSocketAddrSetPort;
# virterror_internal.h
virDispatchError;
+virErrorInitialize;
virRaiseErrorFull;
virReportErrorHelper;
virReportOOMErrorFull;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 639be58..6b1f95e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,19 +35,10 @@ 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 \
@@ -254,27 +245,30 @@ valgrind:
sockettest_SOURCES = \
sockettest.c \
testutils.c testutils.h
-sockettest_LDADD = ../src/libvirt_util.la $(LDADDS)
+sockettest_LDADD = $(LDADDS)
if WITH_XEN
+xen_LDADDS = ../src/libvirt_driver_xen.la
+xen_LDADDS += $(LDADDS)
+
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
@@ -282,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 \
@@ -293,41 +287,41 @@ endif
if WITH_QEMU
qemu_LDADDS = ../src/libvirt_driver_qemu.la
-
if WITH_NETWORK
qemu_LDADDS += ../src/libvirt_driver_network.la
endif
+qemu_LDADDS += $(LDADDS)
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 \
@@ -337,11 +331,15 @@ endif
if WITH_LXC
lxc_LDADDS = ../src/libvirt_driver_lxc.la
+if WITH_NETWORK
+lxc_LDADDS += ../src/libvirt_driver_network.la
+endif
+lxc_LDADDS += $(LDADDS)
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
@@ -350,7 +348,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
@@ -360,7 +358,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
@@ -369,12 +367,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
@@ -445,6 +443,7 @@ commandhelper_SOURCES = \
commandhelper.c
commandhelper_CFLAGS = -Dabs_builddir="\"`pwd`\"" $(AM_CFLAGS)
commandhelper_LDADD = $(LDADDS)
+commandhelper_LDFLAGS = -static
if WITH_LIBVIRTD
libvirtdconftest_SOURCES = \
@@ -460,17 +459,17 @@ virnetmessagetest_SOURCES = \
virnetmessagetest.c testutils.h testutils.c
virnetmessagetest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" \
$(XDR_CFLAGS) $(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
@@ -481,26 +480,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