[libvirt] [PATCH] rpm: require radvd when building network support

Otherwise, if the build machine doesn't have radvd, then the configure test won't wire in anything for the radvd executable, and attempts to use that rpm for ipv6 will fail even on machines where radvd is present. error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory Note that this is a build requirement; the runtime requirement is still optional, and the above failure is still expected for an rpm built with radvd but installed on a non-ipv6 machine. * libvirt.spec.in (with_network): Add BuildRequires for radvd. --- .gnulib | 2 +- libvirt.spec.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/.gnulib b/.gnulib index c2090a8..a01e7c4 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit c2090a84dc3997acada3166772afac94f2d3a25c +Subproject commit a01e7c4c58d3c6cad50974367ec60139cc919973 diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..1e6b5b5 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -78,6 +78,7 @@ %define with_audit 0%{!?_without_audit:0} %define with_dtrace 0%{!?_without_dtrace:0} %define with_cgconfig 0%{!?_without_cgconfig:0} +%define with_ipv6 0%{!?_without_ipv6:0} # Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -339,6 +340,7 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: radvd %endif BuildRequires: bridge-utils %if %{with_sasl} -- 1.7.4

On Wed, Mar 23, 2011 at 08:49:19AM -0600, Eric Blake wrote:
Otherwise, if the build machine doesn't have radvd, then the configure test won't wire in anything for the radvd executable, and attempts to use that rpm for ipv6 will fail even on machines where radvd is present.
error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory
Note that this is a build requirement; the runtime requirement is still optional, and the above failure is still expected for an rpm built with radvd but installed on a non-ipv6 machine.
* libvirt.spec.in (with_network): Add BuildRequires for radvd. --- .gnulib | 2 +- libvirt.spec.in | 2 ++ 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib index c2090a8..a01e7c4 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit c2090a84dc3997acada3166772afac94f2d3a25c +Subproject commit a01e7c4c58d3c6cad50974367ec60139cc919973
I guess you didn't mean to include this.
diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..1e6b5b5 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -78,6 +78,7 @@ %define with_audit 0%{!?_without_audit:0} %define with_dtrace 0%{!?_without_dtrace:0} %define with_cgconfig 0%{!?_without_cgconfig:0} +%define with_ipv6 0%{!?_without_ipv6:0}
This hasn't been used.
# Non-server/HV driver defaults which are always enabled %define with_python 0%{!?_without_python:1} @@ -339,6 +340,7 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: radvd %endif
We also want to 'Requires: radvd' in the later block, so that it is actually present at runtime. For that matter, we're also missing 'Requires: iptables-ipv6' 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 :|

Otherwise, attempts to use ipv6 will fail with: error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory * libvirt.spec.in (with_network): Require radvd. --- v2: also add runtime requirement, and drop junk .gnulib and with_ipv6 cruft that snuck into v1 libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..7aa7037 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -238,6 +238,7 @@ Requires: bridge-utils %if %{with_network} Requires: dnsmasq >= 2.41 Requires: iptables +Requires: radvd %endif %if %{with_nwfilter} Requires: ebtables @@ -339,6 +340,7 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: radvd %endif BuildRequires: bridge-utils %if %{with_sasl} -- 1.7.4

On Wed, Mar 23, 2011 at 08:58:17AM -0600, Eric Blake wrote:
Otherwise, attempts to use ipv6 will fail with:
error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory
* libvirt.spec.in (with_network): Require radvd. ---
v2: also add runtime requirement, and drop junk .gnulib and with_ipv6 cruft that snuck into v1
libvirt.spec.in | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..7aa7037 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -238,6 +238,7 @@ Requires: bridge-utils %if %{with_network} Requires: dnsmasq >= 2.41 Requires: iptables +Requires: radvd %endif
We need iptables-ipv6 there too
%if %{with_nwfilter} Requires: ebtables @@ -339,6 +340,7 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: radvd %endif
Do we also want iptables/iptables-ipv6 for the same reason. Though we have them anyway via with_nwfilter, we should probably be explicit 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 :|

* libvirt.spec.in (Requires): Reorganize requirements a bit; no functional change. --- v3: new patch, to cleanly separate Requires: from BuildRequires:. Should I also do a patch to sort requirements, to make it easier to know where to insert new requirements (in sorted order)? libvirt.spec.in | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..4f1bdc8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -225,7 +225,9 @@ Group: Development/Libraries Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/ -BuildRequires: python-devel + +# All runtime requirements for the libvirt package (runtime requrements +# for subpackages are listed later in those subpackages) # The client side, i.e. shared libs and virsh are in a subpackage Requires: %{name}-client = %{version}-%{release} @@ -259,10 +261,6 @@ Requires: PolicyKit >= 0.6 %endif %endif %if %{with_storage_fs} -# For mount/umount in FS driver -BuildRequires: util-linux -# For showmount in FS driver (netfs discovery) -BuildRequires: nfs-utils Requires: nfs-utils # For glusterfs %if 0%{?fedora} >= 11 @@ -303,6 +301,10 @@ Requires: device-mapper %if %{with_cgconfig} Requires: libcgroup %endif + +# All build-time requirements +BuildRequires: python-devel + %if %{with_xen} BuildRequires: xen-devel %endif @@ -414,6 +416,12 @@ BuildRequires: audit-libs-devel BuildRequires: systemtap-sdt-devel %endif +%if %{with_storage_fs} +# For mount/umount in FS driver +BuildRequires: util-linux +# For showmount in FS driver (netfs discovery) +BuildRequires: nfs-utils +%endif # Fedora build root suckage BuildRequires: gawk -- 1.7.4

Among others, the missing radvd dependency showed up as: error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory even when radvd was installed, because the RADVD preprocessor symbol was missing at configure time. * libvirt.spec.in (with_network): Add BuildRequires for radvd, iptables, and ip6tables. (BuildRequires): Add libxslt and augeas for docs and test. (with_libvirtd): Add module-init-tools for modprobe. (with_nwfilter): Add BuildRequires for ebtables. --- v3: scour configure.ac for all other missing dependencies, make with_network also pull in ip6tables libvirt.spec.in | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4f1bdc8..90e39dd 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -236,15 +236,21 @@ Requires: %{name}-client = %{version}-%{release} # daemon is present %if %{with_libvirtd} Requires: bridge-utils +# for modprobe of pci devices +Requires: module-init-tools +# for /sbin/ip +Requires: iproute %endif %if %{with_network} Requires: dnsmasq >= 2.41 +Requires: radvd +%endif +%if %{with_network} || %{with_nwfilter} Requires: iptables +Requires: iptables-ipv6 %endif %if %{with_nwfilter} Requires: ebtables -Requires: iptables -Requires: iptables-ipv6 %endif # needed for device enumeration %if %{with_hal} @@ -313,6 +319,8 @@ BuildRequires: xmlrpc-c-devel >= 1.14.0 %endif BuildRequires: libxml2-devel BuildRequires: xhtml1-dtds +BuildRequires: libxslt +BuildRequires: augparse BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: gettext @@ -341,8 +349,15 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: iptables +BuildRequires: iptables-ipv6 +BuildRequires: radvd +%endif +%if %{with_nwfilter} +BuildRequires: ebtables %endif BuildRequires: bridge-utils +BuildRequires: module-init-tools %if %{with_sasl} BuildRequires: cyrus-sasl-devel %endif -- 1.7.4

On 03/23/2011 10:38 AM, Eric Blake wrote:
Among others, the missing radvd dependency showed up as:
error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory
even when radvd was installed, because the RADVD preprocessor symbol was missing at configure time.
BuildRequires: libxml2-devel BuildRequires: xhtml1-dtds +BuildRequires: libxslt +BuildRequires: augparse
Shoot - that should be augeaus, for /usr/bin/augparse. But RHEL 5 lacks it, so it needs to be conditional. Also, RHEL 5 was giving me grief about libcurl-devel not being found; looks like it was named curl-devel in older versions. But that is only picked up if esx is being built, so I'm not sure why RHEL 5 insisted on it. Stay tuned for v4. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

Among others, the missing radvd dependency showed up as: error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory even when radvd was installed, because the RADVD preprocessor symbol was missing at configure time. * libvirt.spec.in (with_network): Add BuildRequires for radvd, iptables, and ip6tables. (BuildRequires): Add libxslt and augeas for docs and test. (with_libvirtd): Add module-init-tools for modprobe. (with_nwfilter): Add BuildRequires for ebtables. (with_esx): Fix esx build on RHEL 5, thanks to curl-devel rename. --- v4: No change to patch 1/2; patch 2/2 now works on RHEL 5. libvirt.spec.in | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4f1bdc8..6a1c022 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -236,15 +236,21 @@ Requires: %{name}-client = %{version}-%{release} # daemon is present %if %{with_libvirtd} Requires: bridge-utils +# for modprobe of pci devices +Requires: module-init-tools +# for /sbin/ip +Requires: iproute %endif %if %{with_network} Requires: dnsmasq >= 2.41 +Requires: radvd +%endif +%if %{with_network} || %{with_nwfilter} Requires: iptables +Requires: iptables-ipv6 %endif %if %{with_nwfilter} Requires: ebtables -Requires: iptables -Requires: iptables-ipv6 %endif # needed for device enumeration %if %{with_hal} @@ -313,10 +319,15 @@ BuildRequires: xmlrpc-c-devel >= 1.14.0 %endif BuildRequires: libxml2-devel BuildRequires: xhtml1-dtds +BuildRequires: libxslt BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: gettext BuildRequires: gnutls-devel +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 +# for augparse, optionally used in testing +BuildRequires: augeas +%endif %if %{with_hal} BuildRequires: hal-devel %endif @@ -341,8 +352,15 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: iptables +BuildRequires: iptables-ipv6 +BuildRequires: radvd +%endif +%if %{with_nwfilter} +BuildRequires: ebtables %endif BuildRequires: bridge-utils +BuildRequires: module-init-tools %if %{with_sasl} BuildRequires: cyrus-sasl-devel %endif @@ -406,7 +424,11 @@ BuildRequires: libssh2-devel BuildRequires: netcf-devel >= 0.1.4 %endif %if %{with_esx} +%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 BuildRequires: libcurl-devel +%else +BuildRequires: curl-devel +%endif %endif %if %{with_audit} BuildRequires: audit-libs-devel -- 1.7.4

On Wed, Mar 23, 2011 at 11:24:08AM -0600, Eric Blake wrote:
Among others, the missing radvd dependency showed up as:
error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory
even when radvd was installed, because the RADVD preprocessor symbol was missing at configure time.
* libvirt.spec.in (with_network): Add BuildRequires for radvd, iptables, and ip6tables. (BuildRequires): Add libxslt and augeas for docs and test. (with_libvirtd): Add module-init-tools for modprobe. (with_nwfilter): Add BuildRequires for ebtables. (with_esx): Fix esx build on RHEL 5, thanks to curl-devel rename. ---
v4: No change to patch 1/2; patch 2/2 now works on RHEL 5.
libvirt.spec.in | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 4f1bdc8..6a1c022 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -236,15 +236,21 @@ Requires: %{name}-client = %{version}-%{release} # daemon is present %if %{with_libvirtd} Requires: bridge-utils +# for modprobe of pci devices +Requires: module-init-tools +# for /sbin/ip +Requires: iproute %endif %if %{with_network} Requires: dnsmasq >= 2.41 +Requires: radvd +%endif +%if %{with_network} || %{with_nwfilter} Requires: iptables +Requires: iptables-ipv6 %endif %if %{with_nwfilter} Requires: ebtables -Requires: iptables -Requires: iptables-ipv6 %endif # needed for device enumeration %if %{with_hal} @@ -313,10 +319,15 @@ BuildRequires: xmlrpc-c-devel >= 1.14.0 %endif BuildRequires: libxml2-devel BuildRequires: xhtml1-dtds +BuildRequires: libxslt BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: gettext BuildRequires: gnutls-devel +%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 +# for augparse, optionally used in testing +BuildRequires: augeas +%endif %if %{with_hal} BuildRequires: hal-devel %endif @@ -341,8 +352,15 @@ BuildRequires: libselinux-devel %endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 +BuildRequires: iptables +BuildRequires: iptables-ipv6 +BuildRequires: radvd +%endif +%if %{with_nwfilter} +BuildRequires: ebtables %endif BuildRequires: bridge-utils +BuildRequires: module-init-tools %if %{with_sasl} BuildRequires: cyrus-sasl-devel %endif @@ -406,7 +424,11 @@ BuildRequires: libssh2-devel BuildRequires: netcf-devel >= 0.1.4 %endif %if %{with_esx} +%if 0%{?fedora} >= 9 || 0%{?rhel} >= 6 BuildRequires: libcurl-devel +%else +BuildRequires: curl-devel +%endif %endif %if %{with_audit} BuildRequires: audit-libs-devel
ACK 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 03/23/2011 11:32 AM, Daniel P. Berrange wrote:
On Wed, Mar 23, 2011 at 11:24:08AM -0600, Eric Blake wrote:
Among others, the missing radvd dependency showed up as:
error: Failed to start network ipv6net error: Cannot find radvd - Possibly the package isn't installed: No such file or directory
even when radvd was installed, because the RADVD preprocessor symbol was missing at configure time.
ACK
Thanks; series pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Wed, Mar 23, 2011 at 10:38:25AM -0600, Eric Blake wrote:
* libvirt.spec.in (Requires): Reorganize requirements a bit; no functional change. ---
v3: new patch, to cleanly separate Requires: from BuildRequires:.
Should I also do a patch to sort requirements, to make it easier to know where to insert new requirements (in sorted order)?
libvirt.spec.in | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a62c80..4f1bdc8 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -225,7 +225,9 @@ Group: Development/Libraries Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/ -BuildRequires: python-devel + +# All runtime requirements for the libvirt package (runtime requrements +# for subpackages are listed later in those subpackages)
# The client side, i.e. shared libs and virsh are in a subpackage Requires: %{name}-client = %{version}-%{release} @@ -259,10 +261,6 @@ Requires: PolicyKit >= 0.6 %endif %endif %if %{with_storage_fs} -# For mount/umount in FS driver -BuildRequires: util-linux -# For showmount in FS driver (netfs discovery) -BuildRequires: nfs-utils Requires: nfs-utils # For glusterfs %if 0%{?fedora} >= 11 @@ -303,6 +301,10 @@ Requires: device-mapper %if %{with_cgconfig} Requires: libcgroup %endif + +# All build-time requirements +BuildRequires: python-devel + %if %{with_xen} BuildRequires: xen-devel %endif @@ -414,6 +416,12 @@ BuildRequires: audit-libs-devel BuildRequires: systemtap-sdt-devel %endif
+%if %{with_storage_fs} +# For mount/umount in FS driver +BuildRequires: util-linux +# For showmount in FS driver (netfs discovery) +BuildRequires: nfs-utils +%endif
# Fedora build root suckage BuildRequires: gawk
ACK 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 :|
participants (2)
-
Daniel P. Berrange
-
Eric Blake