[libvirt] [PATCH 00/10] Enable loadable modules for libvirtd

For a long timer we've had the ability to build each libvirt driver as a loadable module. We have never used this by default and as a result it constantly bit-rots. This series fixes various bugs, and then enables it by default in configure. It also makes the PRMs use the loadable modules, adding new new sub-RPMs for each module. We can now finally install minimal libvirt binaries for each hypervisor. ie yum install libvirt-kvm will not pull in Xen libraries!

From: "Daniel P. Berrange" <berrange@redhat.com> The driver modules all use symbols which are defined in libvirt.so. Thus for loading of modules to work, the binary that libvirt.so is linked to must be exported its symbols back to modules. If the libvirt.so itself is dlopen()d then the RTLD_GLOBAL flag must be set. Unfortunately few, if any, programming languages use the RTLD_GLOBAL flag when loading modules :-( This means is it not practical to use driver modules for any libvirt client side drivers (OpenVZ, VMWare, Hyper-V, Remote client, test). This patch changes the build process so only server side drivers are built as modules (Xen, QEMU, LXC, UML) * daemon/libvirtd.c: Add missing load of 'interface' driver * src/Makefile.am: Only build server side drivers as modules * src/libvirt.c: Don't load any driver modules Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/libvirtd.c | 29 +++++++++++- src/Makefile.am | 75 ++----------------------------- src/libvirt.c | 129 ++++++++++++++++++----------------------------------- 3 files changed, 74 insertions(+), 159 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index af07e84..dfab810 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -401,14 +401,39 @@ static void daemonInitialize(void) * If they try to open a connection for a module that * is not loaded they'll get a suitable error at that point */ +# ifdef WITH_NETWORK virDriverLoadModule("network"); +# endif +# ifdef WITH_STORAGE virDriverLoadModule("storage"); +# endif +# ifdef WITH_NODE_DEVICES virDriverLoadModule("nodedev"); +# endif +# ifdef WITH_SECRETS virDriverLoadModule("secret"); +# endif +# ifdef WITH_NWFILTER + virDriverLoadModule("nwfilter"); +# endif +# ifdef WITH_INTERFACE + virDriverLoadModule("interface"); +# endif +# ifdef WITH_QEMU virDriverLoadModule("qemu"); +# endif +# ifdef WITH_LXC virDriverLoadModule("lxc"); +# endif +# ifdef WITH_UML virDriverLoadModule("uml"); - virDriverLoadModule("nwfilter"); +# endif +# ifdef WITH_XEN + virDriverLoadModule("xen"); +# endif +# ifdef WITH_LIBXL + virDriverLoadModule("libxl"); +# endif #else # ifdef WITH_NETWORK networkRegister(); @@ -419,7 +444,7 @@ static void daemonInitialize(void) # ifdef WITH_STORAGE_DIR storageRegister(); # endif -# if defined(WITH_NODE_DEVICES) +# ifdef WITH_NODE_DEVICES nodedevRegister(); # endif # ifdef WITH_SECRETS diff --git a/src/Makefile.am b/src/Makefile.am index a2aae9d..5bc5b58 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -620,27 +620,16 @@ libvirt_driver_la_LIBADD = $(NUMACTL_LIBS) $(GNUTLS_LIBS) $(DLOPEN_LIBS) USED_SYM_FILES = libvirt_private.syms if WITH_TEST -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_test.la -else noinst_LTLIBRARIES += libvirt_driver_test.la libvirt_la_BUILT_LIBADD += libvirt_driver_test.la -endif libvirt_driver_test_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) -if WITH_DRIVER_MODULES -libvirt_driver_test_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) -endif libvirt_driver_test_la_SOURCES = $(TEST_DRIVER_SOURCES) endif if WITH_REMOTE -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_remote.la -else noinst_LTLIBRARIES += libvirt_driver_remote.la libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la -endif libvirt_driver_remote_la_CFLAGS = \ $(GNUTLS_CFLAGS) \ $(XDR_CFLAGS) \ @@ -652,10 +641,6 @@ libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) \ libvirt-net-rpc-client.la \ libvirt-net-rpc-server.la \ libvirt-net-rpc.la -if WITH_DRIVER_MODULES -libvirt_driver_remote_la_LIBADD += ../gnulib/lib/libgnu.la -libvirt_driver_remote_la_LDFLAGS += -module -avoid-version -endif libvirt_driver_remote_la_SOURCES = $(REMOTE_DRIVER_SOURCES) $(srcdir)/remote/remote_driver.c: $(REMOTE_DRIVER_GENERATED) @@ -675,7 +660,8 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_xen.la else noinst_LTLIBRARIES += libvirt_driver_xen.la -libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la +# Stateful, so linked to daemon instead +#libvirt_la_BUILT_LIBADD += libvirt_driver_xen.la endif libvirt_driver_xen_la_CFLAGS = \ $(XEN_CFLAGS) \ @@ -692,86 +678,48 @@ libvirt_driver_xen_la_SOURCES = $(XEN_DRIVER_SOURCES) endif if WITH_PHYP -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_phyp.la -else noinst_LTLIBRARIES += libvirt_driver_phyp.la libvirt_la_BUILT_LIBADD += libvirt_driver_phyp.la -endif libvirt_driver_phyp_la_LIBADD = $(LIBSSH2_LIBS) -if WITH_DRIVER_MODULES -libvirt_driver_phyp_la_LIBADD += ../gnulib/lib/libgnu.la -libvirt_driver_phyp_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) -endif libvirt_driver_phyp_la_CFLAGS = $(LIBSSH2_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES) endif if WITH_OPENVZ -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_openvz.la -else noinst_LTLIBRARIES += libvirt_driver_openvz.la libvirt_la_BUILT_LIBADD += libvirt_driver_openvz.la -endif libvirt_driver_openvz_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) -if WITH_DRIVER_MODULES -libvirt_driver_openvz_la_LIBADD = ../gnulib/lib/libgnu.la -libvirt_driver_openvz_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) -endif libvirt_driver_openvz_la_SOURCES = $(OPENVZ_DRIVER_SOURCES) endif if WITH_VMWARE -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_vmware.la -else noinst_LTLIBRARIES += libvirt_driver_vmware.la libvirt_la_BUILT_LIBADD += libvirt_driver_vmware.la -endif libvirt_driver_vmware_la_CFLAGS = \ -I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS) -if WITH_DRIVER_MODULES -libvirt_driver_vmware_la_LIBADD = ../gnulib/lib/libgnu.la -libvirt_driver_vmware_la_LDFLAGS = -module -avoid-version -endif libvirt_driver_vmware_la_SOURCES = $(VMWARE_DRIVER_SOURCES) endif if WITH_VBOX -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_vbox.la -else noinst_LTLIBRARIES += libvirt_driver_vbox.la libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la -endif libvirt_driver_vbox_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_vbox_la_LIBADD = $(DLOPEN_LIBS) $(MSCOM_LIBS) -if WITH_DRIVER_MODULES -libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la -libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS) -endif libvirt_driver_vbox_la_SOURCES = $(VBOX_DRIVER_SOURCES) endif if WITH_XENAPI -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_xenapi.la -else noinst_LTLIBRARIES += libvirt_driver_xenapi.la libvirt_la_BUILT_LIBADD += libvirt_driver_xenapi.la -endif libvirt_driver_xenapi_la_CFLAGS = $(LIBXENSERVER_CFLAGS) $(LIBCURL_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_xenapi_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_xenapi_la_LIBADD = $(LIBXENSERVER_LIBS) $(LIBCURL_LIBS) -if WITH_DRIVER_MODULES libvirt_driver_xenapi_la_LIBADD += ../gnulib/lib/libgnu.la libvirt_driver_xenapi_la_LDFLAGS += -module -avoid-version -endif libvirt_driver_xenapi_la_SOURCES = $(XENAPI_DRIVER_SOURCES) endif @@ -887,20 +835,12 @@ $(ESX_DRIVER_GENERATED): $(srcdir)/esx/esx_vi_generator.input \ $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/esx/esx_vi_generator.py if WITH_ESX -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_esx.la -else noinst_LTLIBRARIES += libvirt_driver_esx.la libvirt_la_BUILT_LIBADD += libvirt_driver_esx.la -endif libvirt_driver_esx_la_CFLAGS = $(LIBCURL_CFLAGS) \ -I$(top_srcdir)/src/conf -I$(top_srcdir)/src/vmx $(AM_CFLAGS) libvirt_driver_esx_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_esx_la_LIBADD = $(LIBCURL_LIBS) -if WITH_DRIVER_MODULES -libvirt_driver_esx_la_LIBADD += ../gnulib/lib/libgnu.la -libvirt_driver_esx_la_LDFLAGS += -module -avoid-version -endif libvirt_driver_esx_la_SOURCES = $(ESX_DRIVER_SOURCES) libvirt_driver_esx_la_DEPENDENCIES = $(ESX_DRIVER_GENERATED) endif @@ -913,20 +853,12 @@ $(HYPERV_DRIVER_GENERATED): $(srcdir)/hyperv/hyperv_wmi_generator.input \ $(AM_V_GEN)srcdir=$(srcdir) $(PYTHON) $(srcdir)/hyperv/hyperv_wmi_generator.py if WITH_HYPERV -if WITH_DRIVER_MODULES -mod_LTLIBRARIES += libvirt_driver_hyperv.la -else noinst_LTLIBRARIES += libvirt_driver_hyperv.la libvirt_la_BUILT_LIBADD += libvirt_driver_hyperv.la -endif libvirt_driver_hyperv_la_CFLAGS = $(OPENWSMAN_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_hyperv_la_LDFLAGS = $(AM_LDFLAGS) libvirt_driver_hyperv_la_LIBADD = $(OPENWSMAN_LIBS) -if WITH_DRIVER_MODULES -libvirt_driver_hyperv_la_LIBADD += ../gnulib/lib/libgnu.la -libvirt_driver_hyperv_la_LDFLAGS += -module -avoid-version -endif libvirt_driver_hyperv_la_SOURCES = $(HYPERV_DRIVER_SOURCES) endif @@ -956,7 +888,8 @@ if WITH_DRIVER_MODULES mod_LTLIBRARIES += libvirt_driver_interface.la else noinst_LTLIBRARIES += libvirt_driver_interface.la -libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la +# Stateful, so linked to daemon instead +#libvirt_la_BUILT_LIBADD += libvirt_driver_interface.la endif libvirt_driver_interface_la_CFLAGS = $(NETCF_CFLAGS) \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) diff --git a/src/libvirt.c b/src/libvirt.c index 16d1fd5..0a156fc 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -45,37 +45,32 @@ #include "virrandom.h" #include "viruri.h" -#ifndef WITH_DRIVER_MODULES -# ifdef WITH_TEST -# include "test/test_driver.h" -# endif -# ifdef WITH_XEN -# include "xen/xen_driver.h" -# endif -# ifdef WITH_REMOTE -# include "remote/remote_driver.h" -# endif -# ifdef WITH_OPENVZ -# include "openvz/openvz_driver.h" -# endif -# ifdef WITH_VMWARE -# include "vmware/vmware_driver.h" -# endif -# ifdef WITH_PHYP -# include "phyp/phyp_driver.h" -# endif -# ifdef WITH_VBOX -# include "vbox/vbox_driver.h" -# endif -# ifdef WITH_ESX -# include "esx/esx_driver.h" -# endif -# ifdef WITH_HYPERV -# include "hyperv/hyperv_driver.h" -# endif -# ifdef WITH_XENAPI -# include "xenapi/xenapi_driver.h" -# endif +#ifdef WITH_TEST +# include "test/test_driver.h" +#endif +#ifdef WITH_REMOTE +# include "remote/remote_driver.h" +#endif +#ifdef WITH_OPENVZ +# include "openvz/openvz_driver.h" +#endif +#ifdef WITH_VMWARE +# include "vmware/vmware_driver.h" +#endif +#ifdef WITH_PHYP +# include "phyp/phyp_driver.h" +#endif +#ifdef WITH_VBOX +# include "vbox/vbox_driver.h" +#endif +#ifdef WITH_ESX +# include "esx/esx_driver.h" +#endif +#ifdef WITH_HYPERV +# include "hyperv/hyperv_driver.h" +#endif +#ifdef WITH_XENAPI +# include "xenapi/xenapi_driver.h" #endif #define VIR_FROM_THIS VIR_FROM_NONE @@ -424,70 +419,32 @@ virInitialize(void) * Note that the order is important: the first ones have a higher * priority when calling virConnectOpen. */ -#ifdef WITH_DRIVER_MODULES - /* We don't care if any of these fail, because the whole point - * is to allow users to only install modules they want to use. - * If they try to open a connection for a module that - * is not loaded they'll get a suitable error at that point - */ -# ifdef WITH_TEST - virDriverLoadModule("test"); -# endif -# ifdef WITH_XEN - virDriverLoadModule("xen"); -# endif -# ifdef WITH_OPENVZ - virDriverLoadModule("openvz"); -# endif -# ifdef WITH_VMWARE - virDriverLoadModule("vmware"); -# endif -# ifdef WITH_VBOX - virDriverLoadModule("vbox"); -# endif -# ifdef WITH_ESX - virDriverLoadModule("esx"); -# endif -# ifdef WITH_HYPERV - virDriverLoadModule("hyperv"); -# endif -# ifdef WITH_XENAPI - virDriverLoadModule("xenapi"); -# endif -# ifdef WITH_REMOTE - virDriverLoadModule("remote"); -# endif -#else -# ifdef WITH_TEST +#ifdef WITH_TEST if (testRegister() == -1) return -1; -# endif -# ifdef WITH_XEN - if (xenRegister () == -1) return -1; -# endif -# ifdef WITH_OPENVZ +#endif +#ifdef WITH_OPENVZ if (openvzRegister() == -1) return -1; -# endif -# ifdef WITH_VMWARE +#endif +#ifdef WITH_VMWARE if (vmwareRegister() == -1) return -1; -# endif -# ifdef WITH_PHYP +#endif +#ifdef WITH_PHYP if (phypRegister() == -1) return -1; -# endif -# ifdef WITH_VBOX +#endif +#ifdef WITH_VBOX if (vboxRegister() == -1) return -1; -# endif -# ifdef WITH_ESX +#endif +#ifdef WITH_ESX if (esxRegister() == -1) return -1; -# endif -# ifdef WITH_HYPERV +#endif +#ifdef WITH_HYPERV if (hypervRegister() == -1) return -1; -# endif -# ifdef WITH_XENAPI +#endif +#ifdef WITH_XENAPI if (xenapiRegister() == -1) return -1; -# endif -# ifdef WITH_REMOTE +#endif +#ifdef WITH_REMOTE if (remoteRegister () == -1) return -1; -# endif #endif return 0; -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> libvirt_driver_nodedev.la should not link against either libvirt_util.la or gnulib.la, since libvirt.so brings in those deps. * src/Makefile.am: Fix broken linkage of libvirt_driver_nodedev.la Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/Makefile.am | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5bc5b58..999a48a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -987,9 +987,7 @@ libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) libvirt_driver_nodedev_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_nodedev_la_LIBADD = \ - libvirt_util.la \ - ../gnulib/lib/libgnu.la +libvirt_driver_nodedev_la_LIBADD = if HAVE_HAL libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES) -- 1.7.7.6

On 04/02/2012 01:57 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
libvirt_driver_nodedev.la should not link against either libvirt_util.la or gnulib.la, since libvirt.so brings in those deps.
* src/Makefile.am: Fix broken linkage of libvirt_driver_nodedev.la
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/Makefile.am | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
While the series as a whole should not be applied until post-release, I think this one is small enough to qualify as correct, if you'd like to push it out-of-order now. ACK.
diff --git a/src/Makefile.am b/src/Makefile.am index 5bc5b58..999a48a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -987,9 +987,7 @@ libvirt_driver_nodedev_la_SOURCES = $(NODE_DEVICE_DRIVER_SOURCES) libvirt_driver_nodedev_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_nodedev_la_LDFLAGS = $(AM_LDFLAGS) -libvirt_driver_nodedev_la_LIBADD = \ - libvirt_util.la \ - ../gnulib/lib/libgnu.la +libvirt_driver_nodedev_la_LIBADD =
if HAVE_HAL libvirt_driver_nodedev_la_SOURCES += $(NODE_DEVICE_DRIVER_HAL_SOURCES)
-- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@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 <berrange@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

From: "Daniel P. Berrange" <berrange@redhat.com> Only libvirt_driver_storage.la links to libblkid currently. If we are running in a scenario with driver modules, LXC must directly link to it, since it can't assume the storage driver is present Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/Makefile.am | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b677492..2d4636e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -788,6 +788,10 @@ endif libvirt_driver_lxc_la_CFLAGS = \ -I$(top_srcdir)/src/conf $(AM_CFLAGS) libvirt_driver_lxc_la_LIBADD = $(CAPNG_LIBS) +if HAVE_LIBBLKID +libvirt_driver_lxc_la_CFLAGS += $(BLKID_CFLAGS) +libvirt_driver_lxc_la_LIBADD += $(BLKID_LIBS) +endif if WITH_SECDRIVER_SELINUX libvirt_driver_lxc_la_LIBADD += $(SELINUX_LIBS) endif -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> Since we have drivers which depend on each other (ie QEMU/LXC depend on the network driver APIs), we need to use RTLD_GLOBAL instead of RTLD_LOCAL. While this pollutes the calling binary with many more symbols, this is no worse than if we directly link to the drivers, and this only applies to libvirtd * src/driver.c: s/RTLD_LOCAL/RTLD_GLOBAL/ Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/driver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/driver.c b/src/driver.c index 5034277..fb162e0 100644 --- a/src/driver.c +++ b/src/driver.c @@ -59,7 +59,7 @@ virDriverLoadModule(const char *name) goto cleanup; } - handle = dlopen(modfile, RTLD_NOW | RTLD_LOCAL); + handle = dlopen(modfile, RTLD_NOW | RTLD_GLOBAL); if (!handle) { VIR_ERROR(_("failed to load module %s %s"), modfile, dlerror()); goto cleanup; -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> When building as driver modules, it is not possible for the QEMU driver module to reference the DTrace/SystemTAP probes linked into the main libvirt.so. Thus we need to move the QEMU probes into a separate file 'libvirt_qemu_probes.d'. Also rename the existing file from 'probes.d' to 'libvirt_probes.d' while we're at it * daemon/Makefile.am, src/internal.h: Include libvirt_probes.h instead of probes.h * src/Makefile.am: Add rules for libvirt_qemu_probes.d * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Include libvirt_qemu_probes.h * src/libvirt_probes.d: Rename from probes.d * src/libvirt_qemu_probes.d: QEMU specific probes formerly in probes.d Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/Makefile.am | 2 +- src/Makefile.am | 40 ++++++++++++++++++++++++----------- src/internal.h | 2 +- src/{probes.d => libvirt_probes.d} | 21 ------------------ src/libvirt_qemu_probes.d | 21 ++++++++++++++++++ src/qemu/qemu_monitor.c | 4 +++ src/qemu/qemu_monitor_json.c | 4 +++ src/qemu/qemu_monitor_text.c | 4 +++ 8 files changed, 62 insertions(+), 36 deletions(-) rename src/{probes.d => libvirt_probes.d} (78%) create mode 100644 src/libvirt_qemu_probes.d diff --git a/daemon/Makefile.am b/daemon/Makefile.am index db4abf5..f69ed63 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -110,7 +110,7 @@ libvirtd_LDADD = \ $(POLKIT_LIBS) if WITH_DTRACE_PROBES -libvirtd_LDADD += ../src/probes.o +libvirtd_LDADD += ../src/libvirt_probes.o endif libvirtd_LDADD += \ diff --git a/src/Makefile.am b/src/Makefile.am index 2d4636e..9d47bb6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1236,22 +1236,30 @@ libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS) libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE) if WITH_DTRACE_PROBES -libvirt_la_BUILT_LIBADD += probes.o -libvirt_la_DEPENDENCIES += probes.o -nodist_libvirt_la_SOURCES = probes.h +libvirt_la_BUILT_LIBADD += libvirt_probes.o +libvirt_la_DEPENDENCIES += libvirt_probes.o +nodist_libvirt_la_SOURCES = libvirt_probes.h if WITH_REMOTE -$(REMOTE_DRIVER_GENERATED): probes.h +$(REMOTE_DRIVER_GENERATED): libvirt_probes.h endif WITH_REMOTE -BUILT_SOURCES += probes.h libvirt_probes.stp libvirt_functions.stp +BUILT_SOURCES += libvirt_probes.h libvirt_probes.stp libvirt_functions.stp + +if WITH_QEMU +libvirt_driver_qemu_la_LIBADD += libvirt_qemu_probes.o +nodist_libvirt_driver_qemu_la_SOURCES = libvirt_qemu_probes.h +libvirt_driver_qemu_la_DEPENDENCIES = libvirt_qemu_probes.o + +$(libvirt_driver_qemu_la_SOURCES): libvirt_qemu_probes.h +endif tapsetdir = $(datadir)/systemtap/tapset -tapset_DATA = libvirt_probes.stp libvirt_functions.stp +tapset_DATA = libvirt_probes.stp libvirt_qemu_probes.stp libvirt_functions.stp -probes.h: probes.d +%_probes.h: %_probes.d $(AM_V_GEN)$(DTRACE) -o $@ -h -s $< -probes.o: probes.d +%_probes.o: %_probes.d $(AM_V_GEN)$(DTRACE) -o $@ -G -s $< RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \ @@ -1262,13 +1270,19 @@ RPC_PROBE_FILES = $(srcdir)/rpc/virnetprotocol.x \ libvirt_functions.stp: $(RPC_PROBE_FILES) $(srcdir)/rpc/gensystemtap.pl $(AM_V_GEN)perl -w $(srcdir)/rpc/gensystemtap.pl $(RPC_PROBE_FILES) > $@ -libvirt_probes.stp: probes.d $(srcdir)/dtrace2systemtap.pl +libvirt_probes.stp: libvirt_probes.d $(srcdir)/dtrace2systemtap.pl + $(AM_V_GEN)perl -w $(srcdir)/dtrace2systemtap.pl $(bindir) $(sbindir) $(libdir) $< > $@ + +libvirt_qemu_probes.stp: libvirt_qemu_probes.d $(srcdir)/dtrace2systemtap.pl $(AM_V_GEN)perl -w $(srcdir)/dtrace2systemtap.pl $(bindir) $(sbindir) $(libdir) $< > $@ -CLEANFILES += probes.h probes.o libvirt_functions.stp libvirt_probes.stp +CLEANFILES += libvirt_probes.h libvirt_probes.o \ + libvirt_qemu_probes.h libvirt_qemu_probes.o \ + libvirt_functions.stp libvirt_probes.stp \ + libvirt_qemu_probes.stp endif -EXTRA_DIST += probes.d +EXTRA_DIST += libvirt_probes.d libvirt_qemu_probes.d libvirt_qemu_la_SOURCES = libvirt-qemu.c libvirt_qemu_la_LDFLAGS = $(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \ @@ -1455,7 +1469,7 @@ libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \ $(RT_LIBS) \ ../gnulib/lib/libgnu.la if WITH_DTRACE_PROBES -libvirt_lxc_LDADD += probes.o +libvirt_lxc_LDADD += libvirt_probes.o endif if WITH_SECDRIVER_SELINUX libvirt_lxc_LDADD += $(SELINUX_LIBS) @@ -1498,7 +1512,7 @@ virt_aa_helper_LDADD = \ libvirt_util.la \ ../gnulib/lib/libgnu.la if WITH_DTRACE_PROBES -virt_aa_helper_LDADD += probes.o +virt_aa_helper_LDADD += libvirt_probes.o endif virt_aa_helper_CFLAGS = \ -I$(top_srcdir)/src/conf \ diff --git a/src/internal.h b/src/internal.h index ef81cda..a04c4ec 100644 --- a/src/internal.h +++ b/src/internal.h @@ -250,7 +250,7 @@ # if WITH_DTRACE_PROBES # ifndef LIBVIRT_PROBES_H # define LIBVIRT_PROBES_H -# include "probes.h" +# include "libvirt_probes.h" # endif /* LIBVIRT_PROBES_H */ /* Systemtap 1.2 headers have a bug where they cannot handle a diff --git a/src/probes.d b/src/libvirt_probes.d similarity index 78% rename from src/probes.d rename to src/libvirt_probes.d index 9d70cc9..0dac8f3 100644 --- a/src/probes.d +++ b/src/libvirt_probes.d @@ -82,25 +82,4 @@ provider libvirt { probe rpc_keepalive_send(void *ka, void *client, int prog, int vers, int proc); probe rpc_keepalive_received(void *ka, void *client, int prog, int vers, int proc); probe rpc_keepalive_timeout(void *ka, void *client, int coundToDeath, int idle); - - - # file: src/qemu/qemu_monitor.c - # prefix: qemu - # binary: libvirtd - # Monitor lifecycle - probe qemu_monitor_new(void *mon, int refs, int fd); - probe qemu_monitor_ref(void *mon, int refs); - probe qemu_monitor_unref(void *mon, int refs); - probe qemu_monitor_close(void *monm, int refs); - - # High level monitor message processing - probe qemu_monitor_send_msg(void *mon, const char *msg, int fd); - probe qemu_monitor_recv_reply(void *mon, const char *reply); - probe qemu_monitor_recv_event(void *mon, const char *event); - - # Low level monitor I/O processing - probe qemu_monitor_io_process(void *mon, const char *buf, unsigned int len); - probe qemu_monitor_io_read(void *mon, const char *buf, unsigned int len, int ret, int errno); - probe qemu_monitor_io_write(void *mon, const char *buf, unsigned int len, int ret, int errno); - probe qemu_monitor_io_send_fd(void *mon, int fd, int ret, int errno); }; diff --git a/src/libvirt_qemu_probes.d b/src/libvirt_qemu_probes.d new file mode 100644 index 0000000..6916778 --- /dev/null +++ b/src/libvirt_qemu_probes.d @@ -0,0 +1,21 @@ +provider libvirt { + # file: src/qemu/qemu_monitor.c + # prefix: qemu + # binary: libvirtd + # Monitor lifecycle + probe qemu_monitor_new(void *mon, int refs, int fd); + probe qemu_monitor_ref(void *mon, int refs); + probe qemu_monitor_unref(void *mon, int refs); + probe qemu_monitor_close(void *monm, int refs); + + # High level monitor message processing + probe qemu_monitor_send_msg(void *mon, const char *msg, int fd); + probe qemu_monitor_recv_reply(void *mon, const char *reply); + probe qemu_monitor_recv_event(void *mon, const char *event); + + # Low level monitor I/O processing + probe qemu_monitor_io_process(void *mon, const char *buf, unsigned int len); + probe qemu_monitor_io_read(void *mon, const char *buf, unsigned int len, int ret, int errno); + probe qemu_monitor_io_write(void *mon, const char *buf, unsigned int len, int ret, int errno); + probe qemu_monitor_io_send_fd(void *mon, int fd, int ret, int errno); +}; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index e1a8d4c..b024567 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -37,6 +37,10 @@ #include "logging.h" #include "virfile.h" +#ifdef WITH_DTRACE_PROBES +# include "libvirt_qemu_probes.h" +#endif + #define VIR_FROM_THIS VIR_FROM_QEMU #define DEBUG_IO 0 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 7093e1d..76f5b1c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -43,6 +43,10 @@ #include "json.h" #include "ignore-value.h" +#ifdef WITH_DTRACE_PROBES +# include "libvirt_qemu_probes.h" +#endif + #define VIR_FROM_THIS VIR_FROM_QEMU diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 9e2991b..edb5dfd 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -41,6 +41,10 @@ #include "virterror_internal.h" #include "buf.h" +#ifdef WITH_DTRACE_PROBES +# include "libvirt_qemu_probes.h" +#endif + #define VIR_FROM_THIS VIR_FROM_QEMU #define QEMU_CMD_PROMPT "\n(qemu) " -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> * daemon/libvirtd.c: Set custom driver module dir if the current binary name is 'lt-libvirtd' (indicating execution directly from GIT checkout) * src/driver.c, src/driver.h, src/libvirt_driver_modules.syms: Add virDriverModuleInitialize to allow driver module location to be changed Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/libvirtd.c | 6 ++++++ src/driver.c | 18 ++++++++++++++++-- src/driver.h | 1 + src/libvirt_driver_modules.syms | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index dfab810..ead160e 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1341,6 +1341,12 @@ int main(int argc, char **argv) { /* initialize early logging */ virLogSetFromEnv(); +#ifdef WITH_DRIVER_MODULES + if (strstr(argv[0], "lt-libvirtd") && + (access("./.git", R_OK) >= 0 || access("../.git", R_OK) >= 0)) + virDriverModuleInitialize("./src/.libs"); +#endif + while (1) { int optidx = 0; int c; diff --git a/src/driver.c b/src/driver.c index fb162e0..da4bee5 100644 --- a/src/driver.c +++ b/src/driver.c @@ -38,16 +38,30 @@ # include <dlfcn.h> +static const char *moddir = NULL; + +void +virDriverModuleInitialize(const char *defmoddir) +{ + const char *custommoddir = getenv("LIBVIRT_DRIVER_DIR"); + if (custommoddir) + moddir = custommoddir; + else if (defmoddir) + moddir = defmoddir; + else + moddir = DEFAULT_DRIVER_DIR; + VIR_DEBUG("Module dir %s", moddir); +} + void * virDriverLoadModule(const char *name) { - const char *moddir = getenv("LIBVIRT_DRIVER_DIR"); char *modfile = NULL, *regfunc = NULL; void *handle = NULL; int (*regsym)(void); if (moddir == NULL) - moddir = DEFAULT_DRIVER_DIR; + virDriverModuleInitialize(NULL); VIR_DEBUG("Module load %s", name); diff --git a/src/driver.h b/src/driver.h index 03d249b..aa7a377 100644 --- a/src/driver.h +++ b/src/driver.h @@ -1621,6 +1621,7 @@ int virRegisterNWFilterDriver(virNWFilterDriverPtr); # ifdef WITH_LIBVIRTD int virRegisterStateDriver(virStateDriverPtr); # endif +void virDriverModuleInitialize(const char *defmoddir); void *virDriverLoadModule(const char *name); #endif /* __VIR_DRIVER_H__ */ diff --git a/src/libvirt_driver_modules.syms b/src/libvirt_driver_modules.syms index ce8d9b8..a5dd58b 100644 --- a/src/libvirt_driver_modules.syms +++ b/src/libvirt_driver_modules.syms @@ -5,3 +5,4 @@ # driver.h virDriverLoadModule; +virDriverModuleInitialize; -- 1.7.7.6

On 04/02/2012 01:57 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
* daemon/libvirtd.c: Set custom driver module dir if the current binary name is 'lt-libvirtd' (indicating execution directly from GIT checkout) * src/driver.c, src/driver.h, src/libvirt_driver_modules.syms: Add virDriverModuleInitialize to allow driver module location to be changed
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- daemon/libvirtd.c | 6 ++++++ src/driver.c | 18 ++++++++++++++++-- src/driver.h | 1 + src/libvirt_driver_modules.syms | 1 + 4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index dfab810..ead160e 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1341,6 +1341,12 @@ int main(int argc, char **argv) { /* initialize early logging */ virLogSetFromEnv();
+#ifdef WITH_DRIVER_MODULES + if (strstr(argv[0], "lt-libvirtd") && + (access("./.git", R_OK) >= 0 || access("../.git", R_OK) >= 0))
This won't work for builds in deep VPATH (mkdir -p deep/build) or sibling VPATH (mkdir ../build) locations. Can we come up with a solution that doesn't limit us to just in-tree and one-deep directory builds? -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

From: "Daniel P. Berrange" <berrange@redhat.com> To ensure all symbols used by loadable driver modules are exported in libvirt.so, add a test suite that simply loads each driver in turn * tests/Makefile.am, tests/virdrivermoduletest.c: Add a test case for loading drivers Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- tests/Makefile.am | 11 +++++ tests/virdrivermoduletest.c | 104 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 0 deletions(-) create mode 100644 tests/virdrivermoduletest.c diff --git a/tests/Makefile.am b/tests/Makefile.am index adeb803..39ce437 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -91,6 +91,10 @@ test_programs = virshtest sockettest \ virtimetest viruritest virkeyfiletest \ virauthconfigtest +if WITH_DRIVER_MODULES +test_programs += virdrivermoduletest +endif + # This is a fake SSH we use from virnetsockettest ssh_SOURCES = ssh.c ssh_LDADD = $(COVERAGE_LDFLAGS) @@ -510,6 +514,13 @@ utiltest_SOURCES = \ utiltest.c testutils.h testutils.c utiltest_LDADD = $(LDADDS) +if WITH_DRIVER_MODULES +virdrivermoduletest_SOURCES = \ + virdrivermoduletest.c testutils.h testutils.c +virdrivermoduletest_CFLAGS = -Dabs_builddir="\"$(abs_builddir)\"" $(AM_CFLAGS) +virdrivermoduletest_LDADD = $(LDADDS) +endif + if WITH_LIBVIRTD eventtest_SOURCES = \ eventtest.c testutils.h testutils.c diff --git a/tests/virdrivermoduletest.c b/tests/virdrivermoduletest.c new file mode 100644 index 0000000..405574e --- /dev/null +++ b/tests/virdrivermoduletest.c @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2012 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Author: Daniel P. Berrange <berrange@redhat.com> + */ + +#include <config.h> + +#include "testutils.h" +#include "util.h" +#include "virterror_internal.h" +#include "memory.h" +#include "logging.h" +#include "driver.h" + +#define VIR_FROM_THIS VIR_FROM_NONE + +struct testDriverData { + const char *name; + const char *dep1; +}; + + +static int testDriverModule(const void *args) +{ + const struct testDriverData *data = args; + + if (data->dep1 && + !virDriverLoadModule(data->dep1)) + return -1; + + if (!virDriverLoadModule(data->name)) + return -1; + + return 0; +} + + +static int +mymain(void) +{ + int ret = 0; + +#define TEST(name, dep1) \ + do { \ + const struct testDriverData data = { name, dep1 }; \ + if (virtTestRun("Test driver " # name, 1, testDriverModule, &data) < 0) \ + ret = -1; \ + } while (0) + + virDriverModuleInitialize(abs_builddir "/../src/.libs"); + +#ifdef WITH_NETWORK + TEST("network", NULL); +#endif +#ifdef WITH_STORAGE + TEST("storage", NULL); +#endif +#ifdef WITH_NODE_DEVICES + TEST("nodedev", NULL); +#endif +#ifdef WITH_SECRETS + TEST("secret", NULL); +#endif +#ifdef WITH_NWFILTER + TEST("nwfilter", NULL); +#endif +#ifdef WITH_INTERFACE + TEST("interface", NULL); +#endif +#ifdef WITH_QEMU + TEST("qemu", "network"); +#endif +#ifdef WITH_LXC + TEST("lxc", "network"); +#endif +#ifdef WITH_UML + TEST("uml", NULL); +#endif +#ifdef WITH_XEN + TEST("xen", NULL); +#endif +#ifdef WITH_LIBXL + TEST("libxl", NULL); +#endif + + return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE; +} + +VIRT_TEST_MAIN(mymain) -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> Always enable driver modules for libvirtd, if we have dlopen available. This allows more modular packaging by distros and ensures we don't break this config * configure.ac: Default to enable driver modules Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- configure.ac | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 32cc8d0..10a4d4e 100644 --- a/configure.ac +++ b/configure.ac @@ -2334,14 +2334,27 @@ dnl Driver-Modules library AC_ARG_WITH([driver-modules], AC_HELP_STRING([--with-driver-modules], [build drivers as loadable modules @<:@default=no@:>@]), [], - [with_driver_modules=no]) + [with_driver_modules=check]) + +if test "$with_libvirtd" = "no" ; then + with_driver_modules=no +fi DRIVER_MODULE_CFLAGS= DRIVER_MODULE_LIBS= -if test "$with_driver_modules" = "yes"; then +if test "$with_driver_modules" = "yes" || test "$with_driver_modules" = "check"; then if test "$dlfcn_found" != "yes" || test "$dlopen_found" != "yes"; then - AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) + if test "$with_driver_modules" = "yes" ; then + AC_MSG_ERROR([You must have dlfcn.h / dlopen() support to build driver modules]) + else + with_driver_modules=no + fi + else + with_driver_modules=yes fi +fi + +if test "$with_driver_modules" = "yes" ; then DRIVER_MODULE_CFLAGS="-export-dynamic" case $ac_cv_search_dlopen in no*) DRIVER_MODULE_LIBS= ;; -- 1.7.7.6

From: "Daniel P. Berrange" <berrange@redhat.com> Turn on loadable modules for libvirtd. Add new sub-RPMs libvirt-daemon-driver-XXX, one for each loadable .so. Modify the libvirt-daemon-YYY RPMs to depend on each of the individual drivers they required * libvirt.spec.in: Enable driver modules Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 300 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 295 insertions(+), 5 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index b787fde..2d2bab1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -34,6 +34,8 @@ %define server_drivers 1 %endif +# Always build with dlopen'd modules +%define with_driver_modules 1 # Now set the defaults for all the important features, independent # of any particular OS @@ -255,6 +257,25 @@ %endif %endif +%if %{with_udev} || %{with_hal} +%define with_nodedev 1 +%else +%define with_nodedev 0 +%endif + +%if %{with_netcf} +%define with_interface 1 +%else +%define with_interface 0 +%endif + +%if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk} +%define with_storage 1 +%else +%define with_storage 0 +%endif + + # Force QEMU to run as non-root %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 %define qemu_user qemu @@ -602,9 +623,152 @@ Requires: libvirt-daemon = %{version}-%{release} Network filter configuration files for cleaning guest traffic %endif -# XXX when we turn on driver modules, we will need to -# create daemon-drv-XXX sub-RPMs and add them as deps -# to all of the following daemon-XXX RPMs +%if %{with_driver_modules} +%if %{with_network} +%package daemon-driver-network +Summary: Network driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-network +The network driver plugin for the libvirtd daemon, providing +an implementation of the virtual network APIs using the Linux +bridge capabilities. +%endif + + +%if %{with_nwfilter} +%package daemon-driver-nwfilter +Summary: Nwfilter driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-nwfilter +The nwfilter driver plugin for the libvirtd daemon, providing +an implementation of the firewall APIs using the ebtables, +iptables and ip6tables capabilities +%endif + + +%if %{with_nodedev} +%package daemon-driver-nodedev +Summary: Nodedev driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-nodedev +The nodedev driver plugin for the libvirtd daemon, providing +an implementation of the node device APIs using the udev +capabilities. +%endif + + +%if %{with_interface} +%package daemon-driver-interface +Summary: Interface driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-interface +The interface driver plugin for the libvirtd daemon, providing +an implementation of the network interface APIs using the +netcf library +%endif + + +%package daemon-driver-secret +Summary: Secret driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-secret +The secret driver plugin for the libvirtd daemon, providing +an implementation of the secret key APIs. + + +%if %{with_storage} +%package daemon-driver-storage +Summary: Storage driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-storage +The storage driver plugin for the libvirtd daemon, providing +an implementation of the storage APIs using LVM, iSCSI, +parted and more. +%endif + + +%if %{with_qemu} +%package daemon-driver-qemu +Summary: Qemu driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} +# There really is a hard cross-driver dependancy here +Requires: libvirt-daemon-network = %{version}-%{release} + +%description daemon-driver-qemu +The qemu driver plugin for the libvirtd daemon, providing +an implementation of the hypervisor driver APIs using +QEMU +%endif + + +%if %{with_lxc} +%package daemon-driver-lxc +Summary: LXC driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} +# There really is a hard cross-driver dependancy here +Requires: libvirt-daemon-network = %{version}-%{release} + +%description daemon-driver-lxc +The LXC driver plugin for the libvirtd daemon, providing +an implementation of the hypervisor driver APIs using +the Linux kernel +%endif + + +%if %{with_uml} +%package daemon-driver-uml +Summary: Uml driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-uml +The UML driver plugin for the libvirtd daemon, providing +an implementation of the hypervisor driver APIs using +User Mode Linux +%endif + + +%if %{with_xen} +%package daemon-driver-xen +Summary: Xen driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-xen +The Xen driver plugin for the libvirtd daemon, providing +an implementation of the hypervisor driver APIs using +Xen +%endif + + +%if %{with_libxl} +%package daemon-driver-libxl +Summary: Libxl driver plugin for the libvirtd daemon +Group: Development/Libraries +Requires: libvirt-daemon = %{version}-%{release} + +%description daemon-driver-libxl +The Libxl driver plugin for the libvirtd daemon, providing +an implementation of the hypervisor driver APIs using +Libxl +%endif +%endif + + %if %{with_qemu_tcg} %package daemon-qemu @@ -612,6 +776,15 @@ Summary: Server side daemon & driver required to run QEMU guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} +%if %{with_driver_modules} +Requires: libvirt-daemon-driver-qemu = %{version}-%{release} +Requires: libvirt-daemon-driver-interface = %{version}-%{release} +Requires: libvirt-daemon-driver-network = %{version}-%{release} +Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} +Requires: libvirt-daemon-driver-nwilter = %{version}-%{release} +Requires: libvirt-daemon-driver-secret = %{version}-%{release} +Requires: libvirt-daemon-driver-storage = %{version}-%{release} +%endif Requires: qemu %description daemon-qemu @@ -638,6 +811,15 @@ Summary: Server side daemon & driver required to run QEMU guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} +%if %{with_driver_modules} +Requires: libvirt-daemon-driver-qemu = %{version}-%{release} +Requires: libvirt-daemon-driver-interface = %{version}-%{release} +Requires: libvirt-daemon-driver-network = %{version}-%{release} +Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} +Requires: libvirt-daemon-driver-nwilter = %{version}-%{release} +Requires: libvirt-daemon-driver-secret = %{version}-%{release} +Requires: libvirt-daemon-driver-storage = %{version}-%{release} +%endif Requires: qemu-kvm %description daemon-kvm @@ -664,6 +846,15 @@ Summary: Server side daemon & driver required to run LXC guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} +%if %{with_driver_modules} +Requires: libvirt-daemon-driver-lxc = %{version}-%{release} +Requires: libvirt-daemon-driver-interface = %{version}-%{release} +Requires: libvirt-daemon-driver-network = %{version}-%{release} +Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} +Requires: libvirt-daemon-driver-nwilter = %{version}-%{release} +Requires: libvirt-daemon-driver-secret = %{version}-%{release} +Requires: libvirt-daemon-driver-storage = %{version}-%{release} +%endif %description daemon-lxc Server side daemon and driver required to manage the virtualization @@ -689,6 +880,15 @@ Summary: Server side daemon & driver required to run UML guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} +%if %{with_driver_modules} +Requires: libvirt-daemon-driver-uml = %{version}-%{release} +Requires: libvirt-daemon-driver-interface = %{version}-%{release} +Requires: libvirt-daemon-driver-network = %{version}-%{release} +Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} +Requires: libvirt-daemon-driver-nwilter = %{version}-%{release} +Requires: libvirt-daemon-driver-secret = %{version}-%{release} +Requires: libvirt-daemon-driver-storage = %{version}-%{release} +%endif # There are no UML kernel RPMs in Fedora/RHEL to depend on. %description daemon-uml @@ -709,12 +909,26 @@ required to manage the virtualization capabilities of UML. %endif -%if %{with_xen} +%if %{with_xen} || %{with_libxl} %package daemon-xen Summary: Server side daemon & driver required to run XEN guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} +%if %{with_driver_modules} +%if %{with_xen} +Requires: libvirt-daemon-driver-xen = %{version}-%{release} +%endif +%if %{with_libxl} +Requires: libvirt-daemon-driver-libxl = %{version}-%{release} +%endif +Requires: libvirt-daemon-driver-interface = %{version}-%{release} +Requires: libvirt-daemon-driver-network = %{version}-%{release} +Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} +Requires: libvirt-daemon-driver-nwilter = %{version}-%{release} +Requires: libvirt-daemon-driver-secret = %{version}-%{release} +Requires: libvirt-daemon-driver-storage = %{version}-%{release} +%endif Requires: xen %description daemon-xen @@ -951,6 +1165,10 @@ of recent versions of Linux (and other OSes). %define _without_dtrace --without-dtrace %endif +%if ! %{with_driver_modules} +%define _without_driver_modules --without-driver-modules +%endif + %define when %(date +"%%F-%%T") %define where %(hostname) %define who %{?packager}%{!?packager:Unknown} @@ -1005,6 +1223,7 @@ autoreconf -if %{?_without_macvtap} \ %{?_without_audit} \ %{?_without_dtrace} \ + %{?_without_driver_modules} \ %{with_packager} \ %{with_packager_version} \ --with-qemu-user=%{qemu_user} \ @@ -1027,6 +1246,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a +%if %{with_driver_modules} +rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a +%endif %if %{with_network} install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/ @@ -1387,6 +1610,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd %doc docs/*.xml +%if %{with_driver_modules} %if %{with_network} %files daemon-config-network %defattr(-, root, root) @@ -1398,6 +1622,71 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd %{_sysconfdir}/libvirt/nwfilter/*.xml %endif +%if %{with_interface} +%files daemon-driver-interface +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so +%endif + +%if %{with_network} +%files daemon-driver-network +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so +%endif + +%if %{with_nodedev} +%files daemon-driver-nodedev +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so +%endif + +%if %{with_nwfilter} +%files daemon-driver-nwfilter +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so +%endif + +%files daemon-driver-secret +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so + +%if %{with_storage} +%files daemon-driver-storage +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so +%endif + +%if %{with_qemu} +%files daemon-driver-qemu +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so +%endif + +%if %{with_lxc} +%files daemon-driver-lxc +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so +%endif + +%if %{with_uml} +%files daemon-driver-uml +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so +%endif + +%if %{with_xen} +%files daemon-driver-xen +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so +%endif + +%if %{with_libxl} +%files daemon-driver-libxl +%defattr(-, root, root) +%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so +%endif +%endif + %if %{with_qemu_tcg} %files daemon-qemu %defattr(-, root, root) @@ -1443,7 +1732,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd %defattr(-, root, root) %endif -%if %{with_xen} +%if %{with_xen} || %{with_libxl} %files xen %defattr(-, root, root) %endif @@ -1480,6 +1769,7 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd %if %{with_dtrace} %{_datadir}/systemtap/tapset/libvirt_probes.stp +%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp %{_datadir}/systemtap/tapset/libvirt_functions.stp %endif -- 1.7.7.6

On 04/02/2012 01:57 PM, Daniel P. Berrange wrote:
For a long timer we've had the ability to build each libvirt driver as a loadable module. We have never used this by default and as a result it constantly bit-rots.
This series fixes various bugs, and then enables it by default in configure. It also makes the PRMs use the loadable modules, adding new new sub-RPMs for each module. We can now finally install minimal libvirt binaries for each hypervisor.
ie yum install libvirt-kvm
will not pull in Xen libraries!
Awesome. It's too late to justify this in 0.9.11, but I hope to review this in time for 0.9.12. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Apr 02, 2012 at 08:57:11PM +0100, Daniel P. Berrange wrote:
For a long timer we've had the ability to build each libvirt driver as a loadable module. We have never used this by default and as a result it constantly bit-rots.
This series fixes various bugs, and then enables it by default in configure. It also makes the PRMs use the loadable modules, adding new new sub-RPMs for each module. We can now finally install minimal libvirt binaries for each hypervisor.
ie yum install libvirt-kvm
will not pull in Xen libraries!
Okay, I understand the principle, and this sounds good. I'm sorry for not having caught up the RPM server refactoring patch earlier, I would have discussed that scenario, and would have avoided me reverting your patch (I really dislike doing this, I guess that was the first time I ever did this) but this was IMHO too much change and too early. I completely agree with the scenario of being able to do yum install libvirt-kvm and have libvirt daemon, the bits for the daemon qemu/kvm support, and related configuration files being pulled in, as well as hooking up the hypervisor dependency. But to me that means one specific libvirt-kvm package (tied to the daemon anyway the client should be agnostic about it), not two ! We should aim at minimizing the number of actual packages while still providing the needed modularization. So I would expect: - libvirt (the server and its basic config file) - libvirt-client (as usual) - libvirt-kvm (can we merge -kvm and -qemu ?) - libvirt-xen - libvirt-lxc - libvirt-uml - libvirt-network (our default network config) - libvirt-devel (as usual) - libvirt-lock-sanlock (as usual) - libvirt-python (as usual) for a separate split of the documentation currently in the -devel package I'm not so sure it's worth changing but I don't have a strong opinion Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Apr 03, 2012 at 04:22:59PM +0800, Daniel Veillard wrote:
On Mon, Apr 02, 2012 at 08:57:11PM +0100, Daniel P. Berrange wrote:
For a long timer we've had the ability to build each libvirt driver as a loadable module. We have never used this by default and as a result it constantly bit-rots.
This series fixes various bugs, and then enables it by default in configure. It also makes the PRMs use the loadable modules, adding new new sub-RPMs for each module. We can now finally install minimal libvirt binaries for each hypervisor.
ie yum install libvirt-kvm
will not pull in Xen libraries!
Okay, I understand the principle, and this sounds good. I'm sorry for not having caught up the RPM server refactoring patch earlier, I would have discussed that scenario, and would have avoided me reverting your patch (I really dislike doing this, I guess that was the first time I ever did this) but this was IMHO too much change and too early.
I completely agree with the scenario of being able to do
yum install libvirt-kvm
and have libvirt daemon, the bits for the daemon qemu/kvm support, and related configuration files being pulled in, as well as hooking up the hypervisor dependency. But to me that means one specific libvirt-kvm package (tied to the daemon anyway the client should be agnostic about it), not two !
We should aim at minimizing the number of actual packages while still providing the needed modularization. So I would expect: - libvirt (the server and its basic config file)
We can't do that, because changing the base 'libvirt' RPM in this way will break the upgrade path - we need semantics of doing 'yum install libvirt' to remain unchanged from before.
- libvirt-client (as usual) - libvirt-devel (as usual) - libvirt-lock-sanlock (as usual) - libvirt-python (as usual)
Indeed, there was/is no need to change the client side parts - only the server side.
- libvirt-kvm (can we merge -kvm and -qemu ?)
It is not desirable to merge them. In Fedora we don't want to force the install of all the QEMU emulators - we only want to pull in the qemu-kvm emulator most of the time. If apps depend on libvirt-kvm, they will get only the KVM stack, while if they depend on libvirt-qemu they will get the full QEMU stack. In RHEL of course there is no QEMU so that sub-RPM disappears.
- libvirt-xen - libvirt-lxc - libvirt-uml - libvirt-network (our default network config)
We need each dlopen'd .so file to be in a separate RPM. eg so that when you install KVM, you don't pull in xen-libs. As well as the hypervisor drivers though, you have the other pieces like the network/storage/nodedev drivers. As well as the need to split the virbr0 / nwfilter config files out, we get a minimum RPM set with actual %file payloads: - libvirt-daemon - Just the libvirtd daemon, no drivers, no configs - libvirt-daemon-config-network - Just the virbr0 configs - libvirt-daemon-config-nwfilter - Just the firewall configs - libvirt-daemon-driver-XXX - Contains the dlopen'd modules per driver or sub-driver. One for each XXX in: (uml, qemu, xen, lxc, storage, network, nwfilter, interface, nodedev, secrets) For the sake of backwards compatibility / upgrade path we need: - libvirt - Virtual RPM, which Requires all of the above RPMs, to ensure that it pulls in everything that the old libvirt RPM always had. Sice it would be really tedious for apps to have to list Requires: on each libvirt-daemon-driver-XXX module they care about we introduced (and that would be upgrade-safe if we introduce more sub-drivers), we need virtual packages: - libvirt-daemon-YYY - Virtual RPM pulls in the set of drivers required for a specific hypervisor. One for each YYY in (uml, qemu, kvm, xen, lxc). Also depends on the appropriate hypervisr RPM (eg 'qemu', 'qemu-kvm', 'xen') - libvirt-YYY - Virtual RPMs to pull in the set of drivers required for a specific hypervisor, plus the default config files. One for each YYY in (uml, qemu, kvm, xen, lxc). I can see an argument that having 2 sets of virtual packages here is a little bit overkill. Apps could just have added Requires: libvirt-daemon-kvm, libvirt-ademon-config-network if they really want KVM and the default configs. So we could get rid of one of these virtual package sets without any real loss of flexibility. I don't see how we can practically eliminate any other sub-RPMS besides these two, while retained flexibility upon install
for a separate split of the documentation currently in the -devel package I'm not so sure it's worth changing but I don't have a strong opinion
Hmm, I didn't notice we had more docs in -devel. I created the -docs RPM for all the docs that were in the main libvirt RPM - ie the entire copy of the website. I should also have put all the API docs in there too I reckon. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Apr 03, 2012 at 10:06:02AM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 04:22:59PM +0800, Daniel Veillard wrote:
On Mon, Apr 02, 2012 at 08:57:11PM +0100, Daniel P. Berrange wrote:
For a long timer we've had the ability to build each libvirt driver as a loadable module. We have never used this by default and as a result it constantly bit-rots.
This series fixes various bugs, and then enables it by default in configure. It also makes the PRMs use the loadable modules, adding new new sub-RPMs for each module. We can now finally install minimal libvirt binaries for each hypervisor.
ie yum install libvirt-kvm
will not pull in Xen libraries!
Okay, I understand the principle, and this sounds good. I'm sorry for not having caught up the RPM server refactoring patch earlier, I would have discussed that scenario, and would have avoided me reverting your patch (I really dislike doing this, I guess that was the first time I ever did this) but this was IMHO too much change and too early.
I completely agree with the scenario of being able to do
yum install libvirt-kvm
and have libvirt daemon, the bits for the daemon qemu/kvm support, and related configuration files being pulled in, as well as hooking up the hypervisor dependency. But to me that means one specific libvirt-kvm package (tied to the daemon anyway the client should be agnostic about it), not two !
We should aim at minimizing the number of actual packages while still providing the needed modularization. So I would expect: - libvirt (the server and its basic config file)
We can't do that, because changing the base 'libvirt' RPM in this way will break the upgrade path - we need semantics of doing 'yum install libvirt' to remain unchanged from before.
okay, libvirt is the server package, that is full blown version... we can't change that, you're right !
- libvirt-client (as usual) - libvirt-devel (as usual) - libvirt-lock-sanlock (as usual) - libvirt-python (as usual)
Indeed, there was/is no need to change the client side parts - only the server side.
- libvirt-kvm (can we merge -kvm and -qemu ?)
It is not desirable to merge them. In Fedora we don't want to force the install of all the QEMU emulators - we only want to pull in the qemu-kvm emulator most of the time. If apps depend on libvirt-kvm, they will get only the KVM stack, while if they depend on libvirt-qemu they will get the full QEMU stack. In RHEL of course there is no QEMU so that sub-RPM disappears.
okay, let's keep that split, that's 2 different audiences anyway, but I would expect then to share the same .so for the driver
- libvirt-xen - libvirt-lxc - libvirt-uml - libvirt-network (our default network config)
We need each dlopen'd .so file to be in a separate RPM. eg so that when you install KVM, you don't pull in xen-libs. As well as the hypervisor drivers though, you have the other pieces like the network/storage/nodedev drivers. As well as the need to split the virbr0 / nwfilter config files out, we get a minimum RPM set with actual %file payloads:
- libvirt-daemon - Just the libvirtd daemon, no drivers, no configs - libvirt-daemon-config-network - Just the virbr0 configs
let's rename to libvirt-daemon-bridge then !
- libvirt-daemon-config-nwfilter - Just the firewall configs
and libvirt-daemon-nwfilter the fact that the rpm contains config files, or .so, or binaries the user should care only of what functionality is provided. If we split it that much then we must make sure that rpm -i libvirt-daemon-nwfilter will actually restart the server in the %post (and true for most of the others package, may turn into a challenge when installing 4 extension package and we want to avoid restarting the server 4 times !)
- libvirt-daemon-driver-XXX - Contains the dlopen'd modules per driver or sub-driver. One for each XXX in: (uml, qemu, xen, lxc, storage, network, nwfilter, interface, nodedev, secrets)
this is what I dislike, I would prefer to see libvirt-kvm and libvirt-daemon-driver-kvm to be merged (and hence my question about qemu and kvm because the .so would be shared I assume) unless there is a good story for having only the .so in the rpm that's the part I really reacted to when I made my tentative build for the release and that looks way to intricate to my taste.
For the sake of backwards compatibility / upgrade path we need:
- libvirt - Virtual RPM, which Requires all of the above RPMs, to ensure that it pulls in everything that the old libvirt RPM always had.
I really dislike "virtual rpms" . When we splitted -client and the server part we reassigned the server part to the old package, and that worked well since we still had the full dependency chain. Maybe we can't avoid that now, but I would hope that is the only virtual one !
Sice it would be really tedious for apps to have to list Requires: on each libvirt-daemon-driver-XXX module they care about we introduced (and that would be upgrade-safe if we introduce more sub-drivers), we need virtual packages:
- libvirt-daemon-YYY - Virtual RPM pulls in the set of drivers required for a specific hypervisor. One for each YYY in (uml, qemu, kvm, xen, lxc). Also depends on the appropriate hypervisr RPM (eg 'qemu', 'qemu-kvm', 'xen')
- libvirt-YYY - Virtual RPMs to pull in the set of drivers required for a specific hypervisor, plus the default config files. One for each YYY in (uml, qemu, kvm, xen, lxc).
I can see an argument that having 2 sets of virtual packages here is a little bit overkill.
definitely from my own POV,
Apps could just have added
Requires: libvirt-daemon-kvm, libvirt-ademon-config-network
make that libvirt-kvm, libvirt-daemon-bridge and that will sound sane to me.
if they really want KVM and the default configs. So we could get rid of one of these virtual package sets without any real loss of flexibility.
I don't see how we can practically eliminate any other sub-RPMS besides these two, while retained flexibility upon install
for a separate split of the documentation currently in the -devel package I'm not so sure it's worth changing but I don't have a strong opinion
Hmm, I didn't notice we had more docs in -devel. I created the -docs RPM for all the docs that were in the main libvirt RPM - ie the entire copy of the website. I should also have put all the API docs in there too I reckon.
yeah there is still the gtk-doc ones... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Apr 03, 2012 at 05:41:57PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 10:06:02AM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 04:22:59PM +0800, Daniel Veillard wrote:
- libvirt-daemon - Just the libvirtd daemon, no drivers, no configs - libvirt-daemon-config-network - Just the virbr0 configs
let's rename to libvirt-daemon-bridge then !
No, I explicitly chose to have -config' in the name, because this really is just the config files, and we might want to use the name 'libvirt-daemon-bridge' at some point in the future.
- libvirt-daemon-config-nwfilter - Just the firewall configs
and libvirt-daemon-nwfilter
Again, I want config there to ensure that the libvirt-ademon-nwfilter RPM name is availble for future use.
the fact that the rpm contains config files, or .so, or binaries the user should care only of what functionality is provided.
The actual nwfilter functionality is provided in the libvirt-daemon RPM, so to suggest they need to use libvirt-daemon-nwfilter is misleading - this is only some default config files which apps do not need to use if they don't want them - oVirt uses its own configs for example.
If we split it that much then we must make sure that rpm -i libvirt-daemon-nwfilter will actually restart the server in the %post (and true for most of the others package, may turn into a challenge when installing 4 extension package and we want to avoid restarting the server 4 times !)
In the re-post I did, I use %posttrans script to ensure it is restarted once, at the end of the transaction.
- libvirt-daemon-driver-XXX - Contains the dlopen'd modules per driver or sub-driver. One for each XXX in: (uml, qemu, xen, lxc, storage, network, nwfilter, interface, nodedev, secrets)
this is what I dislike, I would prefer to see libvirt-kvm and libvirt-daemon-driver-kvm to be merged (and hence my question about qemu and kvm because the .so would be shared I assume) unless there is a good story for having only the .so in the rpm that's the part I really reacted to when I made my tentative build for the release and that looks way to intricate to my taste.
It is not possible to merge these to. For backwards compatibility, we need 'libvirt' to depend on 'libvirt-daemon-driver-qemu'. We do *not*, however, want 'libvirt' to pull in 'qemu' itself. It becomes clear when you consider what the entry points for application dependancies are: /---> libvirt --------+---------> libvirt-daemon | | ^ | | | | \---------> libvirt-daemon-driver-qemu | | | +---> libvirt-daemon-qemu ------------+--|------> qemu | | +---> libvirt-daemon-kvm ----------------+------> qemu-kvm | App Choice So 'yum install libvirt', does *not* pull in 'qemu', 'qemu-kvm' or 'xen' If we merged the packages as you describe, we'd end up with /---> libvirt --------+---------> libvirt-daemon | | ^ | \-------------\ | | | | | | | V | |----------------------------|--> libvirt-daemon-driver-qemu ---> qemu | | | \------\ | | | V |-------------------------------> libvirt-daemon-driver-qemu ---> qemu-kvm | App Choice So, 'yum install libvirt' would end up pulling in every single hypervisor we support (qemu, qemu-kvm, xen), which is not at all what we want. Separating the libvirt-daemon-XXX packages from the libvirt-daemon-driver-XXX packages is key to achieving the goal of minimising install footprint, while maintaining backwards compatibility with existing RPM deps. Rgards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Apr 03, 2012 at 02:08:11PM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 05:41:57PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 10:06:02AM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 04:22:59PM +0800, Daniel Veillard wrote:
- libvirt-daemon - Just the libvirtd daemon, no drivers, no configs - libvirt-daemon-config-network - Just the virbr0 configs
let's rename to libvirt-daemon-bridge then !
No, I explicitly chose to have -config' in the name, because this really is just the config files, and we might want to use the name 'libvirt-daemon-bridge' at some point in the future.
- libvirt-daemon-config-nwfilter - Just the firewall configs
and libvirt-daemon-nwfilter
Again, I want config there to ensure that the libvirt-ademon-nwfilter RPM name is availble for future use.
the fact that the rpm contains config files, or .so, or binaries the user should care only of what functionality is provided.
The actual nwfilter functionality is provided in the libvirt-daemon RPM, so to suggest they need to use libvirt-daemon-nwfilter is misleading - this is only some default config files which apps do not need to use if they don't want them - oVirt uses its own configs for example.
okay ...
If we split it that much then we must make sure that rpm -i libvirt-daemon-nwfilter will actually restart the server in the %post (and true for most of the others package, may turn into a challenge when installing 4 extension package and we want to avoid restarting the server 4 times !)
In the re-post I did, I use %posttrans script to ensure it is restarted once, at the end of the transaction.
good !
- libvirt-daemon-driver-XXX - Contains the dlopen'd modules per driver or sub-driver. One for each XXX in: (uml, qemu, xen, lxc, storage, network, nwfilter, interface, nodedev, secrets)
this is what I dislike, I would prefer to see libvirt-kvm and libvirt-daemon-driver-kvm to be merged (and hence my question about qemu and kvm because the .so would be shared I assume) unless there is a good story for having only the .so in the rpm that's the part I really reacted to when I made my tentative build for the release and that looks way to intricate to my taste.
It is not possible to merge these to. For backwards compatibility, we need 'libvirt' to depend on 'libvirt-daemon-driver-qemu'. We do *not*, however, want 'libvirt' to pull in 'qemu' itself.
It becomes clear when you consider what the entry points for application dependancies are:
/---> libvirt --------+---------> libvirt-daemon | | ^ | | | | \---------> libvirt-daemon-driver-qemu | | | +---> libvirt-daemon-qemu ------------+--|------> qemu | | +---> libvirt-daemon-kvm ----------------+------> qemu-kvm | App Choice
So 'yum install libvirt', does *not* pull in 'qemu', 'qemu-kvm' or 'xen'
If we merged the packages as you describe, we'd end up with
/---> libvirt --------+---------> libvirt-daemon | | ^ | \-------------\ | | | | | | | V | |----------------------------|--> libvirt-daemon-driver-qemu ---> qemu | | | \------\ | | | V |-------------------------------> libvirt-daemon-driver-qemu ---> qemu-kvm | App Choice
So, 'yum install libvirt' would end up pulling in every single hypervisor we support (qemu, qemu-kvm, xen), which is not at all what we want.
Separating the libvirt-daemon-XXX packages from the libvirt-daemon-driver-XXX packages is key to achieving the goal of minimising install footprint, while maintaining backwards compatibility with existing RPM deps.
I still wonder if it is worth it then. Adding an extra empty rpm just for the sake or avoiding a explicit hypervisor dependency at the application level. The whole scheme adds N + 1 empty rpms just for avoiding that dep that the application need to explicitely state right now anyway. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Apr 03, 2012 at 09:57:19PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 02:08:11PM +0100, Daniel P. Berrange wrote:
So, 'yum install libvirt' would end up pulling in every single hypervisor we support (qemu, qemu-kvm, xen), which is not at all what we want.
Separating the libvirt-daemon-XXX packages from the libvirt-daemon-driver-XXX packages is key to achieving the goal of minimising install footprint, while maintaining backwards compatibility with existing RPM deps.
I still wonder if it is worth it then. Adding an extra empty rpm just for the sake or avoiding a explicit hypervisor dependency at the application level. The whole scheme adds N + 1 empty rpms just for avoiding that dep that the application need to explicitely state right now anyway.
I think it is worth it, based on the fact that we get reasonably frequent bug reports that installing libvirt did not install qemu-kvm, or similar. Also, it avoids the need for applications to care about the different package names - eg in RHEL-5 the RPM was 'kvm', while in RHEL-6, the RPM was 'qemu-kvm', and who knows if it will change again... Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Tue, Apr 03, 2012 at 03:13:54PM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 09:57:19PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 02:08:11PM +0100, Daniel P. Berrange wrote:
So, 'yum install libvirt' would end up pulling in every single hypervisor we support (qemu, qemu-kvm, xen), which is not at all what we want.
Separating the libvirt-daemon-XXX packages from the libvirt-daemon-driver-XXX packages is key to achieving the goal of minimising install footprint, while maintaining backwards compatibility with existing RPM deps.
I still wonder if it is worth it then. Adding an extra empty rpm just for the sake or avoiding a explicit hypervisor dependency at the application level. The whole scheme adds N + 1 empty rpms just for avoiding that dep that the application need to explicitely state right now anyway.
I think it is worth it, based on the fact that we get reasonably frequent bug reports that installing libvirt did not install qemu-kvm, or similar.
In practice now we ask people to install 'qemu-kvm' directly With the change we ask people to install 'libvirt-kvm' instead, I don't see such an huge improvement to be honnest, basically ths means that people must select the hypervisor at some point, whether it's at the base os install vs. at the libvirt install.
Also, it avoids the need for applications to care about the different package names - eg in RHEL-5 the RPM was 'kvm', while in RHEL-6, the RPM was 'qemu-kvm', and who knows if it will change again...
True but it's not like it's changing very often. Okay, I'm too hard to be convinced that it's the right way to go, can someone with a fresh mind on the issue look at it, I won't block, though I'm certainly dragging feets in case it's not clear :-) People do get lost with rpm dependencies and the whole scheme is way too complex IMHO. Now that I have exposed my belief I'm fine being put in the minority :) Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Apr 03, 2012 at 10:44:26PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 03:13:54PM +0100, Daniel P. Berrange wrote:
On Tue, Apr 03, 2012 at 09:57:19PM +0800, Daniel Veillard wrote:
On Tue, Apr 03, 2012 at 02:08:11PM +0100, Daniel P. Berrange wrote:
So, 'yum install libvirt' would end up pulling in every single hypervisor we support (qemu, qemu-kvm, xen), which is not at all what we want.
Separating the libvirt-daemon-XXX packages from the libvirt-daemon-driver-XXX packages is key to achieving the goal of minimising install footprint, while maintaining backwards compatibility with existing RPM deps.
I still wonder if it is worth it then. Adding an extra empty rpm just for the sake or avoiding a explicit hypervisor dependency at the application level. The whole scheme adds N + 1 empty rpms just for avoiding that dep that the application need to explicitely state right now anyway.
I think it is worth it, based on the fact that we get reasonably frequent bug reports that installing libvirt did not install qemu-kvm, or similar.
In practice now we ask people to install 'qemu-kvm' directly With the change we ask people to install 'libvirt-kvm' instead,
Almost. Currently we ask to install 'libvirt' and 'qemu-kvm', now we just need to install 'libvirt-daemon-kvm'.
I don't see such an huge improvement to be honnest, basically ths means that people must select the hypervisor at some point, whether it's at the base os install vs. at the libvirt install.
Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 04/03/2012 08:46 AM, Daniel P. Berrange wrote:
I think it is worth it, based on the fact that we get reasonably frequent bug reports that installing libvirt did not install qemu-kvm, or similar.
In practice now we ask people to install 'qemu-kvm' directly With the change we ask people to install 'libvirt-kvm' instead,
Almost. Currently we ask to install 'libvirt' and 'qemu-kvm', now we just need to install 'libvirt-daemon-kvm'.
I think that being able to select one package instead of two is a benefit (the old way requires me to select both 'libvirt' and 'qemu-kvm' before my kvm guests work, the new way says that I want the one package 'libvirt-daemon-kvm' and I get everything needed for kvm guests).
I don't see such an huge improvement to be honnest, basically ths means that people must select the hypervisor at some point, whether it's at the base os install vs. at the libvirt install.
I look at it as a stack issue - I know that libvirt is in my stack, and since I want to only interact with libvirt, I _don't_ want to know what lower pieces in the stack also have to be pulled in. Having to manually select 'qemu-kvm' is a violation of the layering. For comparison, if I plan on using stdio, I want to use fopen() and fwrite() and friends from just <stdio.h> - I shouldn't have to care that stdio uses open() and write() and close() from <unistd.h> and other lower-level headers. An application using libvirt should not have to know what lower-level components to pull in, they should just pull in the appropriate libvirt package that meets their needs. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Eric Blake