[libvirt] [PATCH v1] build: isolate core libvirt libs deps from xen runtime

Jim Fehlig jfehlig at suse.com
Fri Oct 6 16:28:27 UTC 2017


On 10/06/2017 06:16 AM, Wim Ten Have wrote:
> From: Wim ten Have <wim.ten.have at oracle.com>
> 
> Generating libvirt packages per make rpm, "with-libxl=1" and "with-xen=1",
> adds strict runtime dependencies per libxenlight for xen-libs package from
> core libvirt-libs package.  This is not necessary and unfortunate since
> those dependencies set demand to "xen-libs" package even when there's no
> need for libvirt xen or libxl driver components.
> 
> This patch is to have two separate xenconfig lib tool libraries: one for
> core libvirt (without XL), and a another that contains xl for libxl driver
> (libvirt_driver_libxl_impl.la) which when loading the driver, loads the
> remaining symbols (xen{Format,Parse}XL. For the user/sysadmin, this means
> the xen dependencies are moved into libxl driver, instead of core libvirt.
> 
> Signed-off-by: Joao Martins <joao.m.martins at oracle.com>
> Signed-off-by: Wim ten Have <wim.ten.have at oracle.com>
> ---
>   src/Makefile.am              | 23 +++++++++++++----------
>   src/libvirt_xenxlconfig.syms | 12 ------------
>   2 files changed, 13 insertions(+), 22 deletions(-)
>   delete mode 100644 src/libvirt_xenxlconfig.syms
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 173fba1e6..b74856ba7 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -1197,7 +1197,8 @@ XENCONFIG_SOURCES =						\
>   		xenconfig/xen_sxpr.c xenconfig/xen_sxpr.h	\
>   		xenconfig/xen_xm.c xenconfig/xen_xm.h
>   if WITH_LIBXL
> -XENCONFIG_SOURCES +=						\
> +XENCONFIG_LIBXL_SOURCES =					\
> +		$(XENCONFIG_SOURCES)				\
>   		xenconfig/xen_xl.c xenconfig/xen_xl.h
>   endif WITH_LIBXL
>   
> @@ -1258,10 +1259,17 @@ endif WITH_VMX
>   if WITH_XENCONFIG
>   noinst_LTLIBRARIES += libvirt_xenconfig.la
>   libvirt_la_BUILT_LIBADD += libvirt_xenconfig.la
> -libvirt_xenconfig_la_LIBADD = $(LIBXL_LIBS)
>   libvirt_xenconfig_la_CFLAGS = \
> -		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
> +		-I$(srcdir)/conf $(AM_CFLAGS)
>   libvirt_xenconfig_la_SOURCES = $(XENCONFIG_SOURCES)
> +
> +if WITH_LIBXL
> +noinst_LTLIBRARIES += libvirt_xenconfig_libxl.la
> +libvirt_xenconfig_libxl_la_LIBADD = $(LIBXL_LIBS)
> +libvirt_xenconfig_libxl_la_CFLAGS = \
> +		-I$(srcdir)/conf -I$(srcdir)/libxl $(AM_CFLAGS)
> +libvirt_xenconfig_libxl_la_SOURCES = $(XENCONFIG_LIBXL_SOURCES)
> +endif WITH_LIBXL
>   endif WITH_XENCONFIG
>   
>   
> @@ -1417,7 +1425,7 @@ libvirt_driver_libxl_impl_la_CFLAGS = 		\
>   		$(AM_CFLAGS)
>   libvirt_driver_libxl_impl_la_LDFLAGS = $(AM_LDFLAGS)
>   libvirt_driver_libxl_impl_la_LIBADD = $(LIBXL_LIBS) \
> -				      libvirt_xenconfig.la \
> +				      libvirt_xenconfig_libxl.la \
>   				      libvirt_secret.la
>   libvirt_driver_libxl_impl_la_SOURCES = $(LIBXL_DRIVER_SOURCES)
>   
> @@ -2045,6 +2053,7 @@ EXTRA_DIST +=							\
>   		$(VBOX_DRIVER_EXTRA_DIST)			\
>   		$(VMWARE_DRIVER_SOURCES)			\
>   		$(XENCONFIG_SOURCES)				\
> +		$(XENCONFIG_LIBXL_SOURCES)			\
>   		$(ACCESS_DRIVER_POLKIT_POLICY)
>   
>   check-local: check-augeas
> @@ -2228,12 +2237,6 @@ else ! WITH_XENCONFIG
>   SYM_FILES += $(srcdir)/libvirt_xenconfig.syms
>   endif ! WITH_XENCONFIG
>   
> -if WITH_LIBXL
> -USED_SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
> -else ! WITH_LIBXL
> -SYM_FILES += $(srcdir)/libvirt_xenxlconfig.syms
> -endif ! WITH_LIBXL
> -
>   if WITH_SASL
>   USED_SYM_FILES += $(srcdir)/libvirt_sasl.syms
>   else ! WITH_SASL
> diff --git a/src/libvirt_xenxlconfig.syms b/src/libvirt_xenxlconfig.syms
> deleted file mode 100644
> index dbe43aac7..000000000
> --- a/src/libvirt_xenxlconfig.syms
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -#
> -# These symbols are dependent upon --with-libxl via WITH_LIBXL.
> -#
> -
> -#xenconfig/xen_xl.h
> -xenFormatXL;
> -xenParseXL;
> -
> -# Let emacs know we want case-insensitive sorting
> -# Local Variables:
> -# sort-fold-case: t
> -# End:
> 

I tested with all combinations of {with,without}-{xen,libxl} plus 'make dist' 
and didn't notice any issues, hence

Reviewed-by: Jim Fehlig <jfehlig at suse.com>

I'll push the patch shortly, along with adding a note to my todo list to move 
the files in xenconfig to the libxl driver when removing the legacy xen driver.

Regards,
Jim




More information about the libvir-list mailing list