From 30c61901c8036fa82072d745d166e0a4a8af023b Mon Sep 17 00:00:00 2001 From: Maxim Nestratov Date: Mon, 28 Mar 2016 16:03:00 +0300 Subject: [PATCH] vz: build driver as module and don't register it on client's side Make it possible to build vz driver as a module and don't link it with libvirt.so statically. Remove registering it on client's side as far as we start relying on daemon Signed-off-by: Maxim Nestratov --- daemon/Makefile.am | 4 ++++ daemon/libvirtd.c | 9 +++++++++ src/Makefile.am | 19 ++++++++++++++----- src/libvirt.c | 7 ------- src/libvirt_private.syms | 7 +++++++ 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 2dbe81bf03..78d7d215c6 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -233,6 +233,10 @@ if WITH_VBOX libvirtd_LDADD += ../src/libvirt_driver_vbox.la endif WITH_VBOX +if WITH_VZ + libvirtd_LDADD += ../src/libvirt_driver_vz.la +endif WITH_VZ + if WITH_STORAGE libvirtd_LDADD += ../src/libvirt_driver_storage.la endif WITH_STORAGE diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 3d38a46ee7..92b40801cd 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -102,6 +102,9 @@ # include "nwfilter/nwfilter_driver.h" # endif #endif +#ifdef WITH_VZ +# include "vz/vz_driver.h" +#endif #include "configmake.h" @@ -390,6 +393,9 @@ static void daemonInitialize(void) # ifdef WITH_BHYVE virDriverLoadModule("bhyve"); # endif +# ifdef WITH_VZ + virDriverLoadModule("vz"); +# endif #else # ifdef WITH_NETWORK networkRegister(); @@ -430,6 +436,9 @@ static void daemonInitialize(void) # ifdef WITH_BHYVE bhyveRegister(); # endif +# ifdef WITH_VZ + vzRegister(); +# endif #endif } diff --git a/src/Makefile.am b/src/Makefile.am index eda0365538..08ff301ed4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -630,6 +630,7 @@ DRIVER_SOURCE_FILES = \ $(NULL) STATEFUL_DRIVER_SOURCE_FILES = \ + $(VZ_DRIVER_SOURCES) \ $(BHYVE_DRIVER_SOURCES) \ $(INTERFACE_DRIVER_SOURCES) \ $(LIBXL_DRIVER_SOURCES) \ @@ -886,7 +887,7 @@ HYPERV_DRIVER_EXTRA_DIST = \ hyperv/hyperv_wmi_generator.py \ $(HYPERV_DRIVER_GENERATED) -VZ_DRIVER_SOURCES = \ +VZ_DRIVER_SOURCES = \ vz/vz_driver.h \ vz/vz_driver.c \ vz/vz_utils.c \ @@ -1493,13 +1494,21 @@ libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES) endif WITH_HYPERV if WITH_VZ +noinst_LTLIBRARIES += libvirt_driver_vz_impl.la +libvirt_driver_vz_la_SOURCES = +libvirt_driver_vz_la_LIBADD = libvirt_driver_vz_impl.la +if WITH_DRIVER_MODULES +mod_LTLIBRARIES += libvirt_driver_vz.la +libvirt_driver_vz_la_LIBADD += ../gnulib/lib/libgnu.la +libvirt_driver_vz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) +else ! WITH_DRIVER_MODULES noinst_LTLIBRARIES += libvirt_driver_vz.la -libvirt_la_BUILT_LIBADD += libvirt_driver_vz.la -libvirt_driver_vz_la_CFLAGS = \ +endif ! WITH_DRIVER_MODULES +libvirt_driver_vz_impl_la_CFLAGS = \ -I$(srcdir)/conf $(AM_CFLAGS) \ $(PARALLELS_SDK_CFLAGS) $(LIBNL_CFLAGS) -libvirt_driver_vz_la_LIBADD = $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS) -libvirt_driver_vz_la_SOURCES = $(VZ_DRIVER_SOURCES) +libvirt_driver_vz_impl_la_SOURCES = $(VZ_DRIVER_SOURCES) +libvirt_driver_vz_impl_la_LIBADD = $(PARALLELS_SDK_LIBS) $(LIBNL_LIBS) endif WITH_VZ if WITH_BHYVE diff --git a/src/libvirt.c b/src/libvirt.c index dd58e9c23d..a21d00e408 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -92,9 +92,6 @@ #ifdef WITH_XENAPI # include "xenapi/xenapi_driver.h" #endif -#ifdef WITH_VZ -# include "vz/vz_driver.h" -#endif #ifdef WITH_BHYVE # include "bhyve/bhyve_driver.h" #endif @@ -433,10 +430,6 @@ virGlobalInit(void) if (xenapiRegister() == -1) goto error; # endif -# ifdef WITH_VZ - if (vzRegister() == -1) - goto error; -# endif #endif #ifdef WITH_REMOTE if (remoteRegister() == -1) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e5bf9c614a..1bcb3af37b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -929,6 +929,11 @@ virGetSecret; virGetStoragePool; virGetStorageVol; virGetStream; +virConnectCloseCallbackDataGetCallback; +virNewConnectCloseCallbackData; +virConnectCloseCallbackDataUnregister; +virConnectCloseCallbackDataRegister; +virConnectCloseCallbackDataCall; virInterfaceClass; virNetworkClass; virNodeDeviceClass; @@ -937,6 +942,7 @@ virSecretClass; virStoragePoolClass; virStorageVolClass; virStreamClass; +virConnectCloseCallbackDataClass; # fdstream.h @@ -1304,6 +1310,7 @@ virCommandHandshakeWait; virCommandNew; virCommandNewArgList; virCommandNewArgs; +virCommandNewVAList; virCommandNonblockingFDs; virCommandPassFD; virCommandPassFDGetFDIndex;