rpc: don't link in second copy of RPC code to libvirtd & lockd plugin

The libvirt_driver_remote.la static library is linked into the
libvirt.so dynamic library, providing both the generic RPC layer code
and the remote protocol client driver. The libvirtd daemon the itself
links to libvirt_driver_remote.la, in order to get access to the generic
RPC layer code and the XDR functions for the remote driver. This means
we get multiple copies of the same code in libvirtd, one direct and one
indirect via libvirt.so. The same mistake affects the lockd plugin.

The libvirtd daemon should instead just link aganist the generic RPC
layer code that's in libvirt.so. This is easily doable if we add exports
for the few symbols we've previously missed, and wildcard export xdr_*
to expose the auto-generated XDR marshallers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-01-25 09:35:47 +00:00
parent 064fec69be
commit c3b24e7051
3 changed files with 15 additions and 9 deletions

View File

@ -176,7 +176,6 @@ libvirtd_LDADD += \
../src/libvirt_driver_admin.la \
../src/libvirt-lxc.la \
../src/libvirt-qemu.la \
../src/libvirt_driver_remote.la \
$(NULL)
libvirtd_LDADD += ../src/libvirt.la

View File

@ -1316,16 +1316,11 @@ if WITH_REMOTE
noinst_LTLIBRARIES += libvirt_driver_remote.la
libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
libvirt_driver_remote_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(XDR_CFLAGS) \
-I$(srcdir)/conf \
-I$(srcdir)/rpc \
$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \
libvirt-net-rpc-client.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc.la
libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES)
BUILT_SOURCES += $(REMOTE_DRIVER_GENERATED)
@ -2602,8 +2597,6 @@ lockd_la_CFLAGS = -I$(srcdir)/conf \
$(AM_CFLAGS)
lockd_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
lockd_la_LIBADD = ../gnulib/lib/libgnu.la \
libvirt-net-rpc.la \
libvirt-net-rpc-client.la \
$(NULL)
augeas_DATA += locking/libvirt_lockd.aug
if WITH_DTRACE_PROBES
@ -2919,6 +2912,11 @@ noinst_LTLIBRARIES += \
libvirt-net-rpc-server.la \
libvirt-net-rpc-client.la
libvirt_la_BUILT_LIBADD += \
libvirt-net-rpc.la \
libvirt-net-rpc-server.la \
libvirt-net-rpc-client.la
EXTRA_DIST += \
dtrace2systemtap.pl \
rpc/gendispatch.pl \

View File

@ -5,6 +5,9 @@
# Keep this file sorted by header name, then by symbols with each header.
#
# Generated files
xdr_*;
# rpc/virnetclient.h
virNetClientAddProgram;
virNetClientAddStream;
@ -80,6 +83,7 @@ virNetDaemonUpdateServices;
# rpc/virnetmessage.h
virNetMessageAddFD;
virNetMessageClear;
virNetMessageClearPayload;
virNetMessageDecodeHeader;
@ -96,7 +100,6 @@ virNetMessageNew;
virNetMessageQueuePush;
virNetMessageQueueServe;
virNetMessageSaveError;
xdr_virNetMessageError;
# rpc/virnetserver.h
@ -104,12 +107,14 @@ virNetServerAddClient;
virNetServerAddProgram;
virNetServerAddService;
virNetServerClose;
virNetServerGetClient;
virNetServerGetClients;
virNetServerGetCurrentClients;
virNetServerGetCurrentUnauthClients;
virNetServerGetMaxClients;
virNetServerGetMaxUnauthClients;
virNetServerGetName;
virNetServerGetThreadPoolParameters;
virNetServerHasClients;
virNetServerNew;
virNetServerNewPostExecRestart;
@ -117,6 +122,8 @@ virNetServerNextClientID;
virNetServerPreExecRestart;
virNetServerProcessClients;
virNetServerSetClientAuthenticated;
virNetServerSetClientLimits;
virNetServerSetThreadPoolParameters;
virNetServerStart;
virNetServerUpdateServices;
@ -128,11 +135,13 @@ virNetServerClientCloseLocked;
virNetServerClientDelayedClose;
virNetServerClientGetAuth;
virNetServerClientGetFD;
virNetServerClientGetID;
virNetServerClientGetIdentity;
virNetServerClientGetInfo;
virNetServerClientGetPrivateData;
virNetServerClientGetReadonly;
virNetServerClientGetSELinuxContext;
virNetServerClientGetTimestamp;
virNetServerClientGetTransport;
virNetServerClientGetUNIXIdentity;
virNetServerClientImmediateClose;