[libvirt] [PATCH] specfile: require libnl3 for Fedora >= 18 and RHEL >= 7

Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so) This patch does two things when fedora >= 18 || rhel >= 7): 1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater (the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 18a7fb8..4b4d1d0 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -409,8 +409,12 @@ BuildRequires: sanlock-devel >= 1.8 BuildRequires: libpcap-devel %endif %if %{with_libnl} +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: libnl3-devel +%else BuildRequires: libnl-devel %endif +%endif %if %{with_avahi} BuildRequires: avahi-devel %endif @@ -489,13 +493,18 @@ BuildRequires: libcap-ng-devel >= 0.5.0 %if %{with_phyp} BuildRequires: libssh2-devel %endif + %if %{with_netcf} +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: netcf-devel >= 0.2.2 +%else %if 0%{?fedora} >= 16 || 0%{?rhel} >= 6 BuildRequires: netcf-devel >= 0.1.8 %else BuildRequires: netcf-devel >= 0.1.4 %endif %endif +%endif %if %{with_esx} %if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 BuildRequires: libcurl-devel -- 1.7.11.4

On 08/24/2012 03:57 PM, Laine Stump wrote:
Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so)
This patch does two things when fedora >= 18 || rhel >= 7):
1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater
(the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+)
Makes sense - you have my ACK from a review standpoint, although I'd at least like to test a build against the netcf package from F18 updates-testing if we have time to do that before DV cuts the 0.10.0 release.
+ %if %{with_netcf} +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: netcf-devel >= 0.2.2 +%else %if 0%{?fedora} >= 16 || 0%{?rhel} >= 6 BuildRequires: netcf-devel >= 0.1.8
Question - should we _also_ be stating that on F17, netcf must be less than 0.2.2? I don't know if the specfile format allows you to specify a version window, or if it even makes sense (I'm guessing that 'yum update' will detect the .so conflict even if we don't specify a maximum version, if you try to rebuild too-new netcf on an older Fedora). So I don't think this comment requires you to make any changes. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 08/24/2012 06:04 PM, Eric Blake wrote:
On 08/24/2012 03:57 PM, Laine Stump wrote:
Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so)
This patch does two things when fedora >= 18 || rhel >= 7):
1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater
(the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) Makes sense - you have my ACK from a review standpoint, although I'd at least like to test a build against the netcf package from F18 updates-testing if we have time to do that before DV cuts the 0.10.0 release.
+ %if %{with_netcf} +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: netcf-devel >= 0.2.2 +%else %if 0%{?fedora} >= 16 || 0%{?rhel} >= 6 BuildRequires: netcf-devel >= 0.1.8 Question - should we _also_ be stating that on F17, netcf must be less than 0.2.2?
Not necessary, because any netcf built on F17 will always be built with libnl1. (as long as you're doing an rpm build using the specfile; and if you're not using the specfile, then nothing you put in the specfile will help you :-)
I don't know if the specfile format allows you to specify a version window, or if it even makes sense (I'm guessing that 'yum update' will detect the .so conflict even if we don't specify a maximum version, if you try to rebuild too-new netcf on an older Fedora).
Even if we were to update netcf to 0.2.2 on F17, the specfile would still ensure that the proper libnl would be built. (To make sure that's the case even if you have both libnl-devels installed, I added a small bit to netcf's specfile after your review that forces configure to be run with --with-libnl1 on F17/RHE6.x and previous)
So I don't think this comment requires you to make any changes.
Thanks. I'm not pushing yet - first the proper netcf build has to be in place.

On 08/24/2012 06:04 PM, Eric Blake wrote:
On 08/24/2012 03:57 PM, Laine Stump wrote:
Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so)
This patch does two things when fedora >= 18 || rhel >= 7):
1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater
(the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) Makes sense - you have my ACK from a review standpoint, although I'd at least like to test a build against the netcf package from F18 updates-testing if we have time to do that before DV cuts the 0.10.0 release.
Okay. I've made the netcf-0.2.2 upstream release that has the specfile changes, updated both rawhide and F18 packages, made a build for both and verified that they did use libnl3 rather than libnl1, and requested the F18 package be pushed to updates-testing. Here is the link to the f18 package: https://admin.fedoraproject.org/updates/netcf-0.2.2-1.fc18 The will be in updates-testing "soon" (I don't know if they do it once a day or twice a day). I'm also not sure if a buildroot override is still necessary once a package has hit updates-testing. If so, here's the link to the page that describes how to set that up: https://fedoraproject.org/wiki/Bodhi/BuildRootOverrides

On 08/24/2012 06:04 PM, Eric Blake wrote:
On 08/24/2012 03:57 PM, Laine Stump wrote:
Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so)
This patch does two things when fedora >= 18 || rhel >= 7):
1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater
(the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) Makes sense - you have my ACK from a review standpoint, although I'd at least like to test a build against the netcf package from F18 updates-testing if we have time to do that before DV cuts the 0.10.0 release.
Okay, I've cut the netcf-0.2.2 release, done builds for F18 and rawhide, submitted the F18 update, and added a build-override to force use of netcf-0.2.2.fc18. On the libvirt side, I tried a scratch build on f18 and found a problem with CFLAGS that only occurs when building on a system that has libnl3-devel only (no libnl-devel). I pushed a patch for that (because it's a one line build breaker) and scratch builds with the updated libvirt.spec now build properly with netcf-0.2.2 and libnl3-devel. So everything should be okay to push the original patch in this thread. As we've discussed, it will be much simpler to deal with if we can do that before 0.10.0 is released, but I won't be around during the week to make sure it happens (unless someone ACKs in the next 5 hours or so :-) So - if/when you ACK the patch, please also push it. Thanks!

On Sat, Aug 25, 2012 at 02:57:28PM -0400, Laine Stump wrote:
On 08/24/2012 06:04 PM, Eric Blake wrote:
On 08/24/2012 03:57 PM, Laine Stump wrote:
Everything is ready in both netcf and libvirt to switch over to libnl3 in future releases of both Fedora and RHEL. This needs to be done more or less simultaneously in both packages, though, because you can't mix libnl1.1 and libnl3 in the same process (e.g. libvirtd using libnl-3.so and libnetcf.so, while libnetcf.so uses libnl.so)
This patch does two things when fedora >= 18 || rhel >= 7):
1) requires libnl3-devel 2) requires netcf-devel-0.2.2 or greater
(the idea is that a similar patch is going into netcf's specfile, so that when a build of netcf is done on F18 or later (or RHEL7 or later) netcf will be guaranteed to be built with libnl3 rather than libnl-1.1) --- libvirt.spec.in | 9 +++++++++ 1 file changed, 9 insertions(+) Makes sense - you have my ACK from a review standpoint, although I'd at least like to test a build against the netcf package from F18 updates-testing if we have time to do that before DV cuts the 0.10.0 release.
Okay, I've cut the netcf-0.2.2 release, done builds for F18 and rawhide, submitted the F18 update, and added a build-override to force use of netcf-0.2.2.fc18.
On the libvirt side, I tried a scratch build on f18 and found a problem with CFLAGS that only occurs when building on a system that has libnl3-devel only (no libnl-devel). I pushed a patch for that (because it's a one line build breaker) and scratch builds with the updated libvirt.spec now build properly with netcf-0.2.2 and libnl3-devel.
So everything should be okay to push the original patch in this thread. As we've discussed, it will be much simpler to deal with if we can do that before 0.10.0 is released, but I won't be around during the week to make sure it happens (unless someone ACKs in the next 5 hours or so :-)
So - if/when you ACK the patch, please also push it.
Thanks!
ACK, too, I'm pushing this for rc2, 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/

(pushing under the build breaker rule) When libvirt_lxc is built, it uses the utility library and #includes virnetdev.h, which #includes virnetlink.h, which includes <netlink/msg.h>. Normally, the netlink include directory would be just off /usr/include, so that wouldn't create a problem, but on Fedora and RHEL systems using libnl3, the libnl includes have been moved into /usr/include/libnl3 (to allow concurrent installation of libnl-1.1). All other binaries that need it have added $(LIBNL_CFLAGS) to their CFLAGS, but not libvirt_lxc, so it fails to build on Fedora and RHEL that have only libnl3-devel installed. This was previously unnoticed because everyone was building with libnl headers in /usr/include/netlink (even on systems with the headers in /usr/include/libnl3/netlink, many people (like me) usually also have the libnl1.1 headers in /usr/include/netlink). This patch adds the necessary CFLAGS for libvirt_lxc. Note that we don't need to add $(LIBNL_LIBS) to the LDADD for this binary, because it never directly calls libnl functions, but only calls them indirectly through the util library, which it's already linking against. --- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 995e032..95e1bea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1650,7 +1650,8 @@ libvirt_lxc_LDADD += $(APPARMOR_LIBS) endif libvirt_lxc_CFLAGS = \ -I$(top_srcdir)/src/conf \ - $(AM_CFLAGS) + $(AM_CFLAGS) \ + $(LIBNL_CFLAGS) if HAVE_LIBBLKID libvirt_lxc_CFLAGS += $(BLKID_CFLAGS) libvirt_lxc_LDADD += $(BLKID_LIBS) -- 1.7.11.4

On Sat, Aug 25, 2012 at 1:48 PM, Laine Stump <laine@laine.org> wrote:
(pushing under the build breaker rule)
When libvirt_lxc is built, it uses the utility library and #includes virnetdev.h, which #includes virnetlink.h, which includes <netlink/msg.h>.
Normally, the netlink include directory would be just off /usr/include, so that wouldn't create a problem, but on Fedora and RHEL systems using libnl3, the libnl includes have been moved into /usr/include/libnl3 (to allow concurrent installation of libnl-1.1).
All other binaries that need it have added $(LIBNL_CFLAGS) to their CFLAGS, but not libvirt_lxc, so it fails to build on Fedora and RHEL that have only libnl3-devel installed. This was previously unnoticed because everyone was building with libnl headers in /usr/include/netlink (even on systems with the headers in /usr/include/libnl3/netlink, many people (like me) usually also have the libnl1.1 headers in /usr/include/netlink).
This patch adds the necessary CFLAGS for libvirt_lxc.
Note that we don't need to add $(LIBNL_LIBS) to the LDADD for this binary, because it never directly calls libnl functions, but only calls them indirectly through the util library, which it's already linking against. --- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 995e032..95e1bea 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1650,7 +1650,8 @@ libvirt_lxc_LDADD += $(APPARMOR_LIBS) endif libvirt_lxc_CFLAGS = \ -I$(top_srcdir)/src/conf \ - $(AM_CFLAGS) + $(AM_CFLAGS) \ + $(LIBNL_CFLAGS) if HAVE_LIBBLKID libvirt_lxc_CFLAGS += $(BLKID_CFLAGS) libvirt_lxc_LDADD += $(BLKID_LIBS) -- 1.7.11.4
Despite not needing an ACK. ACK anyway because I had to do the same thing for Gentoo just now since we install libnl3 the same way as Fedora. -- Doug Goldstein
participants (4)
-
Daniel Veillard
-
Doug Goldstein
-
Eric Blake
-
Laine Stump