diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..fa93037 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,10 @@ +# recipients: libvirt-qe +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +subject_type: brew-build +rules: + - !PassingTestCaseRule {test_case_name: libvirt-ci.libvirt.brew-build.gating.x86_64.tier1.functional} + - !PassingTestCaseRule {test_case_name: libvirt-ci.libvirt-python.brew-build.gating.x86_64.tier1.functional} + - !PassingTestCaseRule {test_case_name: libvirt-ci.libvirt.brew-build.gating.s390x.tier1.functional} diff --git a/libvirt.spec b/libvirt.spec index 8206143..b3823a7 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -90,6 +90,7 @@ # Other optional features %define with_numactl 0%{!?_without_numactl:1} +%define with_userfaultfd_sysctl 0%{!?_without_userfaultfd_sysctl:1} # A few optional bits off by default, we enable later %define with_fuse 0 @@ -204,6 +205,18 @@ %define with_modular_daemons 1 %endif +# Prefer nftables for future OS releases but keep using iptables +# for existing ones +%if 0%{?rhel} >= 10 || 0%{?fedora} >= 41 + %define prefer_nftables 1 + %define firewall_backend_priority nftables,iptables +%else + %define prefer_nftables 0 + %define firewall_backend_priority iptables,nftables +%endif + + + # Force QEMU to run as non-root %define qemu_user qemu %define qemu_group qemu @@ -246,6 +259,12 @@ %define enable_werror -Dwerror=false -Dgit_werror=disabled %endif +# Fedora and RHEL-9 are new enough to support /dev/userfaultfd, which +# does not require enabling vm.unprivileged_userfaultfd sysctl. +%if 0%{?fedora} || 0%{?rhel} >= 9 + %define with_userfaultfd_sysctl 0 +%endif + %define tls_priority "@LIBVIRT,SYSTEM" # libvirt 8.1.0 stops distributing any sysconfig files. @@ -269,12 +288,12 @@ Summary: Library providing a simple virtualization API Name: libvirt -Version: 10.0.0 -Release: 3%{?dist} +Version: 10.4.0 +Release: 1%{?dist}%{?extra_release} License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1 URL: https://libvirt.org/ -%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1 +%if %(echo %{version} | grep "\.0$" >/dev/null; echo $?) == 1 %define mainturl stable_updates/ %endif Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz @@ -329,10 +348,10 @@ BuildRequires: gcc %if %{with_libxl} BuildRequires: xen-devel %endif -BuildRequires: glib2-devel >= 2.56 +BuildRequires: glib2-devel >= 2.58 BuildRequires: libxml2-devel BuildRequires: readline-devel -BuildRequires: bash-completion >= 2.0 +BuildRequires: pkgconfig(bash-completion) >= 2.0 BuildRequires: libtasn1-devel BuildRequires: gnutls-devel BuildRequires: libattr-devel @@ -349,8 +368,6 @@ BuildRequires: sanlock-devel >= 2.4 BuildRequires: libpcap-devel >= 1.5.0 BuildRequires: libnl3-devel BuildRequires: libselinux-devel -BuildRequires: iptables -BuildRequires: ebtables # For modprobe BuildRequires: kmod BuildRequires: cyrus-sasl-devel @@ -587,7 +604,11 @@ Summary: Network driver plugin for the libvirtd daemon Requires: libvirt-daemon-common = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release} Requires: dnsmasq >= 2.41 + %if %{prefer_nftables} +Requires: nftables + %else Requires: iptables + %endif %description daemon-driver-network The network driver plugin for the libvirtd daemon, providing @@ -613,6 +634,7 @@ Requires: libvirt-libs = %{version}-%{release} # needed for device enumeration Requires: systemd >= 185 # For managing persistent mediated devices +# Note: for nodedev-update support at least mdevctl v1.3.0 is required Requires: mdevctl # for modprobe of pci devices Requires: module-init-tools @@ -807,6 +829,7 @@ Requires: gzip Requires: bzip2 Requires: lzop Requires: xz +Requires: zstd Requires: systemd-container Requires: swtpm-tools %if %{with_numad} @@ -894,6 +917,7 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} +Requires: libvirt-ssh-proxy = %{version}-%{release} Requires: qemu %description daemon-qemu @@ -922,6 +946,7 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} +Requires: libvirt-ssh-proxy = %{version}-%{release} Requires: qemu-kvm %description daemon-kvm @@ -1091,6 +1116,13 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} Libvirt plugin for NSS for translating domain names into IP addresses. %endif +%package ssh-proxy +Summary: Libvirt SSH proxy +Requires: libvirt-libs = %{version}-%{release} + +%description ssh-proxy +Allows SSH into domains via VSOCK without need for network. + %if %{with_mingw32} %package -n mingw32-libvirt Summary: %{summary} @@ -1116,7 +1148,10 @@ MinGW Windows libvirt virtualization library. %endif %prep -%autosetup -S git_am +%autosetup -S git_am -N + +%autopatch + %build %if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel} @@ -1276,6 +1311,12 @@ exit 1 %define arg_remote_mode -Dremote_default_mode=legacy %endif +%if %{with_userfaultfd_sysctl} + %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=enabled +%else + %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=disabled +%endif + %define when %(date +"%%F-%%T") %define where %(hostname) %define who %{?packager}%{!?packager:Unknown} @@ -1355,9 +1396,13 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dqemu_moddir=%{qemu_moddir} \ -Dqemu_datadir=%{qemu_datadir} \ -Dtls_priority=%{tls_priority} \ + -Dsysctl_config=enabled \ + %{?arg_userfaultfd_sysctl} \ + -Dssh_proxy=enabled \ %{?enable_werror} \ -Dexpensive_tests=enabled \ -Dinit_script=systemd \ + -Dfirewall_backend_priority=%{firewall_backend_priority} \ -Ddocs=enabled \ -Dtests=enabled \ -Drpath=disabled \ @@ -1438,6 +1483,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dstorage_vstorage=disabled \ -Dstorage_zfs=disabled \ -Dsysctl_config=disabled \ + -Duserfaultfd_sysctl=disabled \ + -Dssh_proxy=disabled \ -Dtests=disabled \ -Dudev=disabled \ -Dwireshark_dissector=disabled \ @@ -1473,6 +1520,7 @@ chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml %if ! %{with_qemu} rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug +rm -f $RPM_BUILD_ROOT%{_sysusersdir}/libvirt-qemu.conf %endif %find_lang %{name} @@ -1834,16 +1882,19 @@ exit 0 %pre daemon-driver-qemu %libvirt_sysconfig_pre virtqemud %libvirt_systemd_unix_pre virtqemud + # We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then - useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu +# are commonly shared across NFS mounts by id rather than name. +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/ +# We can not use the sysusers_create_compat macro here as we want to keep the +# specfile standalone and not relying on additionnal files. +getent group 'kvm' >/dev/null || groupadd -f -g '36' -r 'kvm' || : +getent group 'qemu' >/dev/null || groupadd -f -g '107' -r 'qemu' || : +if ! getent passwd 'qemu' >/dev/null; then + if ! getent passwd '107' >/dev/null; then + useradd -r -u '107' -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || : else - useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu + useradd -r -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || : fi fi exit 0 @@ -2087,6 +2138,9 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf %{_datadir}/augeas/lenses/virtnetworkd.aug %{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug +%config(noreplace) %{_sysconfdir}/libvirt/network.conf +%{_datadir}/augeas/lenses/libvirtd_network.aug +%{_datadir}/augeas/lenses/tests/test_libvirtd_network.aug %{_unitdir}/virtnetworkd.service %{_unitdir}/virtnetworkd.socket %{_unitdir}/virtnetworkd-ro.socket @@ -2211,7 +2265,9 @@ exit 0 %if %{with_qemu} %files daemon-driver-qemu %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf + %if %{with_userfaultfd_sysctl} %config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf + %endif %{_datadir}/augeas/lenses/virtqemud.aug %{_datadir}/augeas/lenses/tests/test_virtqemud.aug %{_unitdir}/virtqemud.service @@ -2246,6 +2302,7 @@ exit 0 %{_bindir}/virt-qemu-run %{_mandir}/man1/virt-qemu-run.1* %{_mandir}/man8/virtqemud.8* +%{_sysusersdir}/libvirt-qemu.conf %endif %if %{with_lxc} @@ -2401,6 +2458,10 @@ exit 0 %{_libdir}/libnss_libvirt.so.2 %{_libdir}/libnss_libvirt_guest.so.2 +%files ssh-proxy +%config(noreplace) %{_sysconfdir}/ssh/ssh_config.d/30-libvirt-ssh-proxy.conf +%{_libexecdir}/libvirt-ssh-proxy + %if %{with_lxc} %files login-shell %attr(4750, root, virtlogin) %{_bindir}/virt-login-shell @@ -2562,8 +2623,12 @@ exit 0 %{mingw64_mandir}/man7/virkey*.7* %endif - %changelog +* Wed Jun 5 2024 Jiri Denemark - 10.4.0-1 +- Rebased to libvirt-10.4.0 (RHEL-29893) +- The rebase also fixes the following bugs: + RHEL-30177, RHEL-35244, RHEL-39024 + * Thu Jan 25 2024 Fedora Release Engineering - 10.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..6f8e5e8 --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,8 @@ +inspections: + abidiff: off + +emptyrpm: + expected_empty: + - libvirt + - libvirt-daemon-driver-storage + - libvirt-daemon-kvm diff --git a/sources b/sources index c02b15d..f84031b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libvirt-10.0.0.tar.xz) = 4ab28539ff0e9a78ac231b11b4ec88b91d76ff2607cabd0226f04aaece73b05cab4aa9cfcf05073cd257ea270a377cd5d2cb915971583dbec04dadf2cf7ad252 +SHA512 (libvirt-10.4.0.tar.xz) = 711be39f3fb831a5073b25a5b02410676147114f3dcf85b24c8505b611a81bf64cf3b95f66908e0dc3a2f3e66e5fc31b2d95db610ea3f1b747a9fd1f52b1ffa7