[libvirt] [RFC] [PATCH 1/3 v2] vepa+vsi: Introduce dependency on libnl

This patch introduces a dependency on libnl, which subsequent patches will then use. Changes from V1 to V2: - added diffstats - following changes in tree Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --- configure.ac | 24 ++++++++++++++++++++++++ libvirt.spec.in | 14 ++++++++++++++ src/Makefile.am | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -42,6 +42,7 @@ HAL_REQUIRED=0.5.0 DEVMAPPER_REQUIRED=1.0.0 LIBCURL_REQUIRED="7.18.0" LIBPCAP_REQUIRED="1.0.0" +LIBNL_REQUIRED="1.1" dnl Checks for C compiler. AC_PROG_CC @@ -2005,6 +2006,24 @@ fi AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) +dnl netlink library + +LIBNL_CFLAGS="" +LIBNL_LIBS="" + +if test "$with_macvtap" = "yes"; then + PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ + ], [ + AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap support]) + ]) +fi + +AC_SUBST([LIBNL_CFLAGS]) +AC_SUBST([LIBNL_LIBS]) + + + + # Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball. # Copy one to the other, but only if this is a srcdir-build. @@ -2183,6 +2202,11 @@ AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS else AC_MSG_NOTICE([ pcap: no]) fi +if test "$with_macvtap" = "yes" ; then +AC_MSG_NOTICE([ nl: $LIBNL_CFLAGS $LIBNL_LIBS]) +else +AC_MSG_NOTICE([ nl: no]) +fi AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) Index: libvirt-acl/libvirt.spec.in =================================================================== --- libvirt-acl.orig/libvirt.spec.in +++ libvirt-acl/libvirt.spec.in @@ -63,6 +63,7 @@ %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} +%define with_macvtap 0%{!?_without_macvtap:0} # Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -153,6 +154,11 @@ %if %{with_qemu} %define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}} %define with_libpcap 0%{!?_without_libpcap:%{server_drivers}} +%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}} +%endif + +%if %{with_macvtap} +%define with_libnl 1 %endif # Force QEMU to run as non-root @@ -282,6 +288,9 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +%endif %if %{with_avahi} BuildRequires: avahi-devel %endif @@ -531,6 +540,10 @@ of recent versions of Linux (and other O %define _without_libpcap --without-libpcap %endif +%if ! %{with_macvtap} +%define _without_macvtap --without-macvtap +%endif + %configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \ @@ -560,6 +573,7 @@ of recent versions of Linux (and other O %{?_without_udev} \ %{?_without_yajl} \ %{?_without_libpcap} \ + %{?_without_macvtap} \ --with-qemu-user=%{qemu_user} \ --with-qemu-group=%{qemu_group} \ --with-init-script=redhat \ Index: libvirt-acl/src/Makefile.am =================================================================== --- libvirt-acl.orig/src/Makefile.am +++ libvirt-acl/src/Makefile.am @@ -998,7 +998,7 @@ libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FL $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la libvirt_la_LIBADD += $(LIBXML_LIBS) \ - $(LIBPCAP_LIBS) \ + $(LIBPCAP_LIBS) $(LIBNL_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT @@ -1057,7 +1057,7 @@ libvirt_lxc_SOURCES = \ libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \ $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ - ../gnulib/lib/libgnu.la + $(LIBNL_LIBS) ../gnulib/lib/libgnu.la libvirt_lxc_CFLAGS = \ $(LIBPARTED_CFLAGS) \ $(NUMACTL_CFLAGS) \

* Stefan Berger (stefanb@linux.vnet.ibm.com) wrote:
This patch introduces a dependency on libnl, which subsequent patches will then use.
Changes from V1 to V2: - added diffstats - following changes in tree
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
This looks good to me Acked-by: Chris Wright <chrisw@redhat.com>

This patch introduces a dependency on libnl, which subsequent patches will then use. Changes from V2 to V3: - Added requirement for libnl during runtime (Requires: libnl) Changes from V1 to V2: - added diffstats - following changes in tree Signed-off-by: Stefan Berger <stefanb@us.ibm.com> --- configure.ac | 24 ++++++++++++++++++++++++ libvirt.spec.in | 14 ++++++++++++++ src/Makefile.am | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-) Index: libvirt-acl/configure.ac =================================================================== --- libvirt-acl.orig/configure.ac +++ libvirt-acl/configure.ac @@ -42,6 +42,7 @@ HAL_REQUIRED=0.5.0 DEVMAPPER_REQUIRED=1.0.0 LIBCURL_REQUIRED="7.18.0" LIBPCAP_REQUIRED="1.0.0" +LIBNL_REQUIRED="1.1" dnl Checks for C compiler. AC_PROG_CC @@ -2005,6 +2006,24 @@ fi AM_CONDITIONAL([WITH_MACVTAP], [test "$with_macvtap" = "yes"]) +dnl netlink library + +LIBNL_CFLAGS="" +LIBNL_LIBS="" + +if test "$with_macvtap" = "yes"; then + PKG_CHECK_MODULES([LIBNL], [libnl-1 >= $LIBNL_REQUIRED], [ + ], [ + AC_MSG_ERROR([libnl >= $LIBNL_REQUIRED is required for macvtap support]) + ]) +fi + +AC_SUBST([LIBNL_CFLAGS]) +AC_SUBST([LIBNL_LIBS]) + + + + # Only COPYING.LIB is under version control, yet COPYING # is included as part of the distribution tarball. # Copy one to the other, but only if this is a srcdir-build. @@ -2183,6 +2202,11 @@ AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS else AC_MSG_NOTICE([ pcap: no]) fi +if test "$with_macvtap" = "yes" ; then +AC_MSG_NOTICE([ nl: $LIBNL_CFLAGS $LIBNL_LIBS]) +else +AC_MSG_NOTICE([ nl: no]) +fi AC_MSG_NOTICE([]) AC_MSG_NOTICE([Test suite]) AC_MSG_NOTICE([]) Index: libvirt-acl/libvirt.spec.in =================================================================== --- libvirt-acl.orig/libvirt.spec.in +++ libvirt-acl/libvirt.spec.in @@ -63,6 +63,7 @@ %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} +%define with_macvtap 0%{!?_without_macvtap:0} # Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -153,6 +154,11 @@ %if %{with_qemu} %define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}} %define with_libpcap 0%{!?_without_libpcap:%{server_drivers}} +%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}} +%endif + +%if %{with_macvtap} +%define with_libnl 1 %endif # Force QEMU to run as non-root @@ -283,6 +289,10 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +Requires: libnl +%endif %if %{with_avahi} BuildRequires: avahi-devel %endif @@ -532,6 +542,10 @@ of recent versions of Linux (and other O %define _without_libpcap --without-libpcap %endif +%if ! %{with_macvtap} +%define _without_macvtap --without-macvtap +%endif + %configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \ @@ -561,6 +575,7 @@ of recent versions of Linux (and other O %{?_without_udev} \ %{?_without_yajl} \ %{?_without_libpcap} \ + %{?_without_macvtap} \ --with-qemu-user=%{qemu_user} \ --with-qemu-group=%{qemu_group} \ --with-init-script=redhat \ Index: libvirt-acl/src/Makefile.am =================================================================== --- libvirt-acl.orig/src/Makefile.am +++ libvirt-acl/src/Makefile.am @@ -999,7 +999,7 @@ libvirt_la_LDFLAGS = $(VERSION_SCRIPT_FL $(CYGWIN_EXTRA_LDFLAGS) $(MINGW_EXTRA_LDFLAGS) libvirt_la_BUILT_LIBADD += ../gnulib/lib/libgnu.la libvirt_la_LIBADD += $(LIBXML_LIBS) \ - $(LIBPCAP_LIBS) \ + $(LIBPCAP_LIBS) $(LIBNL_LIBS) \ $(DRIVER_MODULE_LIBS) \ $(CYGWIN_EXTRA_LIBADD) libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT @@ -1058,7 +1058,7 @@ libvirt_lxc_SOURCES = \ libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS) libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \ $(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \ - ../gnulib/lib/libgnu.la + $(LIBNL_LIBS) ../gnulib/lib/libgnu.la libvirt_lxc_CFLAGS = \ $(LIBPARTED_CFLAGS) \ $(NUMACTL_CFLAGS) \

On 05/24/2010 06:24 AM, Stefan Berger wrote:
This patch introduces a dependency on libnl, which subsequent patches will then use.
I'm hoping that this is the correct version to be reviewing - but since it looks like the vepa patches depend on this one, we need to push this one through :)
--- configure.ac | 24 ++++++++++++++++++++++++ libvirt.spec.in | 14 ++++++++++++++ src/Makefile.am | 4 ++-- 3 files changed, 40 insertions(+), 2 deletions(-
ACK; tested that it picked up the library for me. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On 05/24/2010 06:24 AM, Stefan Berger wrote:
@@ -283,6 +289,10 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +Requires: libnl +%endif
Correction - it was pointed out to me on IRC that the 'Requires: libnl' line is not necessary (compare with the libpcap segment above) - the rpm build process will automatically picks up any Requires dependencies discovered during .so tracing. If you haven't pushed yet, then adjust that one line. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Tue, 2010-05-25 at 11:58 -0600, Eric Blake wrote:
On 05/24/2010 06:24 AM, Stefan Berger wrote:
@@ -283,6 +289,10 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +Requires: libnl +%endif
Correction - it was pointed out to me on IRC that the 'Requires: libnl' line is not necessary (compare with the libpcap segment above) - the rpm build process will automatically picks up any Requires dependencies discovered during .so tracing. If you haven't pushed yet, then adjust that one line.
I haven't pushed it but will remove the line. Still waiting for an ACK on the patch. Stefan

On 05/25/2010 02:34 PM, Stefan Berger wrote:
On Tue, 2010-05-25 at 11:58 -0600, Eric Blake wrote:
On 05/24/2010 06:24 AM, Stefan Berger wrote:
@@ -283,6 +289,10 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +Requires: libnl +%endif
Correction - it was pointed out to me on IRC that the 'Requires: libnl' line is not necessary (compare with the libpcap segment above) - the rpm build process will automatically picks up any Requires dependencies discovered during .so tracing. If you haven't pushed yet, then adjust that one line.
I haven't pushed it but will remove the line. Still waiting for an ACK on the patch.
Stefan
I considered the ACK in Eric's previous message as binding. If one isn't enough, then I'll ACK as well, since I've been using it and it's doing the right thing. (BTW, in case you didn't see my message on IRC, the other patches are being reviewed right now, so should be ready for push RSN)

On Tue, 2010-05-25 at 14:53 -0400, Laine Stump wrote:
On 05/25/2010 02:34 PM, Stefan Berger wrote:
On Tue, 2010-05-25 at 11:58 -0600, Eric Blake wrote:
On 05/24/2010 06:24 AM, Stefan Berger wrote:
@@ -283,6 +289,10 @@ BuildRequires: yajl-devel %if %{with_libpcap} BuildRequires: libpcap-devel %endif +%if %{with_libnl} +BuildRequires: libnl-devel +Requires: libnl +%endif
Correction - it was pointed out to me on IRC that the 'Requires: libnl' line is not necessary (compare with the libpcap segment above) - the rpm build process will automatically picks up any Requires dependencies discovered during .so tracing. If you haven't pushed yet, then adjust that one line.
I haven't pushed it but will remove the line. Still waiting for an ACK on the patch.
Stefan
I considered the ACK in Eric's previous message as binding. If one isn't enough, then I'll ACK as well, since I've been using it and it's doing the right thing.
(BTW, in case you didn't see my message on IRC, the other patches are being reviewed right now, so should be ready for push RSN)
Pushed now without the 'Requires: libnl' line. Stefan
participants (4)
-
Chris Wright
-
Eric Blake
-
Laine Stump
-
Stefan Berger