119c2d
# -*- rpm-spec -*-
119c2d
119c2d
# This spec file assumes you are building on a Fedora or RHEL version
119c2d
# that's still supported by the vendor. It may work on other distros
119c2d
# or versions, but no effort will be made to ensure that going forward.
119c2d
%define min_rhel 8
119c2d
%define min_fedora 33
119c2d
119c2d
%define arches_qemu_kvm         %{ix86} x86_64 %{power64} %{arm} aarch64 s390x
119c2d
%if 0%{?rhel}
119c2d
    %if 0%{?rhel} > 8
119c2d
        %define arches_qemu_kvm     x86_64 aarch64 s390x
119c2d
    %else
119c2d
        %define arches_qemu_kvm     x86_64 %{power64} aarch64 s390x
119c2d
    %endif
119c2d
%endif
119c2d
119c2d
%define arches_64bit            x86_64 %{power64} aarch64 s390x riscv64
119c2d
%define arches_x86              %{ix86} x86_64
119c2d
119c2d
%define arches_systemtap_64bit  %{arches_64bit}
119c2d
%define arches_dmidecode        %{arches_x86}
119c2d
%define arches_xen              %{arches_x86} aarch64
119c2d
%define arches_vbox             %{arches_x86}
119c2d
%define arches_ceph             %{arches_64bit}
119c2d
%define arches_zfs              %{arches_x86} %{power64} %{arm}
119c2d
%define arches_numactl          %{arches_x86} %{power64} aarch64 s390x
119c2d
%define arches_numad            %{arches_x86} %{power64} aarch64
119c2d
119c2d
# The hypervisor drivers that run in libvirtd
119c2d
%define with_qemu          0%{!?_without_qemu:1}
119c2d
%define with_lxc           0%{!?_without_lxc:1}
119c2d
%define with_libxl         0%{!?_without_libxl:1}
119c2d
%define with_vbox          0%{!?_without_vbox:1}
119c2d
119c2d
%ifarch %{arches_qemu_kvm}
119c2d
    %define with_qemu_kvm      %{with_qemu}
119c2d
%else
119c2d
    %define with_qemu_kvm      0
119c2d
%endif
119c2d
119c2d
%define with_qemu_tcg      %{with_qemu}
119c2d
119c2d
# RHEL disables TCG on all architectures
119c2d
%if 0%{?rhel}
119c2d
    %define with_qemu_tcg 0
119c2d
%endif
119c2d
119c2d
%if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
119c2d
    %define with_qemu 0
119c2d
%endif
119c2d
119c2d
# Then the hypervisor drivers that run outside libvirtd, in libvirt.so
119c2d
%define with_openvz        0%{!?_without_openvz:1}
119c2d
%define with_vmware        0%{!?_without_vmware:1}
119c2d
%define with_esx           0%{!?_without_esx:1}
119c2d
%define with_hyperv        0%{!?_without_hyperv:1}
119c2d
119c2d
# Then the secondary host drivers, which run inside libvirtd
119c2d
%define with_storage_rbd      0%{!?_without_storage_rbd:1}
119c2d
%if 0%{?fedora}
119c2d
    %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1}
119c2d
%else
119c2d
    %define with_storage_sheepdog 0
119c2d
%endif
119c2d
119c2d
%define with_storage_gluster 0%{!?_without_storage_gluster:1}
119c2d
%if 0%{?rhel}
119c2d
    # Glusterfs has been dropped in RHEL-9, and before that
119c2d
    # was only enabled on arches where KVM exists
119c2d
    %if 0%{?rhel} > 8
119c2d
        %define with_storage_gluster 0
119c2d
    %else
119c2d
        %ifnarch %{arches_qemu_kvm}
119c2d
            %define with_storage_gluster 0
119c2d
        %endif
119c2d
    %endif
119c2d
%endif
119c2d
119c2d
# Fedora has zfs-fuse
119c2d
%if 0%{?fedora}
119c2d
    %define with_storage_zfs      0%{!?_without_storage_zfs:1}
119c2d
%else
119c2d
    %define with_storage_zfs      0
119c2d
%endif
119c2d
119c2d
%define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
119c2d
# libiscsi has been dropped in RHEL-9
119c2d
%if 0%{?rhel} > 8
119c2d
    %define with_storage_iscsi_direct 0
119c2d
%endif
119c2d
119c2d
# Other optional features
119c2d
%define with_numactl          0%{!?_without_numactl:1}
119c2d
119c2d
# A few optional bits off by default, we enable later
119c2d
%define with_fuse             0
119c2d
%define with_sanlock          0
119c2d
%define with_numad            0
119c2d
%define with_firewalld_zone   0
119c2d
%define with_netcf            0
119c2d
%define with_libssh2          0
119c2d
%define with_wireshark        0
119c2d
%define with_libssh           0
119c2d
%define with_dmidecode        0
119c2d
119c2d
# Finally set the OS / architecture specific special cases
119c2d
119c2d
# Architecture-dependent features
119c2d
%ifnarch %{arches_xen}
119c2d
    %define with_libxl 0
119c2d
%endif
119c2d
%ifnarch %{arches_vbox}
119c2d
    %define with_vbox 0
119c2d
%endif
119c2d
%ifnarch %{arches_numactl}
119c2d
    %define with_numactl 0
119c2d
%endif
119c2d
%ifnarch %{arches_zfs}
119c2d
    %define with_storage_zfs 0
119c2d
%endif
119c2d
%ifnarch %{arches_ceph}
119c2d
    %define with_storage_rbd 0
119c2d
%endif
119c2d
119c2d
# RHEL doesn't ship many hypervisor drivers
119c2d
%if 0%{?rhel}
119c2d
    %define with_openvz 0
119c2d
    %define with_vbox 0
119c2d
    %define with_vmware 0
119c2d
    %define with_libxl 0
119c2d
    %define with_hyperv 0
119c2d
    %define with_vz 0
119c2d
    %define with_lxc 0
119c2d
%endif
119c2d
119c2d
%define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
119c2d
119c2d
%if (0%{?fedora} && 0%{?fedora} < 34) || (0%{?rhel} && 0%{?rhel} < 9)
119c2d
    %define with_netcf 0%{!?_without_netcf:1}
119c2d
%endif
119c2d
119c2d
119c2d
# fuse is used to provide virtualized /proc for LXC
119c2d
%if %{with_lxc}
119c2d
    %define with_fuse      0%{!?_without_fuse:1}
119c2d
%endif
119c2d
119c2d
# Enable sanlock library for lock management with QEMU
119c2d
# Sanlock is available only on arches where kvm is available for RHEL
119c2d
%if 0%{?fedora}
119c2d
    %define with_sanlock 0%{!?_without_sanlock:1}
119c2d
%endif
119c2d
%if 0%{?rhel}
119c2d
    %ifarch %{arches_qemu_kvm}
119c2d
        %define with_sanlock 0%{!?_without_sanlock:1}
119c2d
    %endif
119c2d
%endif
119c2d
119c2d
# Enable libssh2 transport for new enough distros
119c2d
%if 0%{?fedora}
119c2d
    %define with_libssh2 0%{!?_without_libssh2:1}
119c2d
%endif
119c2d
119c2d
# Enable wireshark plugins for all distros
119c2d
%define with_wireshark 0%{!?_without_wireshark:1}
119c2d
%define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
119c2d
119c2d
# Enable libssh transport for all distros
119c2d
%define with_libssh 0%{!?_without_libssh:1}
119c2d
119c2d
%if %{with_qemu} || %{with_lxc}
119c2d
# numad is used to manage the CPU and memory placement dynamically,
119c2d
# it's not available on many non-x86 architectures.
119c2d
    %ifarch %{arches_numad}
119c2d
        %define with_numad    0%{!?_without_numad:1}
119c2d
    %endif
119c2d
%endif
119c2d
119c2d
%ifarch %{arches_dmidecode}
119c2d
    %define with_dmidecode 0%{!?_without_dmidecode:1}
119c2d
%endif
119c2d
119c2d
%define with_modular_daemons 0
119c2d
%if 0%{?fedora} >= 35 || 0%{?rhel} >= 9
119c2d
    %define with_modular_daemons 1
119c2d
%endif
119c2d
119c2d
# Force QEMU to run as non-root
119c2d
%define qemu_user  qemu
119c2d
%define qemu_group  qemu
119c2d
119c2d
# Locations for QEMU data
119c2d
%define qemu_moddir %{_libdir}/qemu
119c2d
%define qemu_datadir %{_datadir}/qemu
119c2d
119c2d
119c2d
# RHEL releases provide stable tool chains and so it is safe to turn
119c2d
# compiler warning into errors without being worried about frequent
119c2d
# changes in reported warnings
119c2d
%if 0%{?rhel}
119c2d
    %define enable_werror -Dwerror=true
119c2d
%else
119c2d
    %define enable_werror -Dwerror=false -Dgit_werror=disabled
119c2d
%endif
119c2d
119c2d
%define tls_priority "@LIBVIRT,SYSTEM"
119c2d
119c2d
# libvirt 8.1.0 stops distributing any sysconfig files.
119c2d
# If the user has customized their sysconfig file,
119c2d
# the RPM upgrade path will rename it to .rpmsave
119c2d
# because the file is no longer managed by RPM.
119c2d
# To prevent a regression we rename it back after the
119c2d
# transaction to preserve the user's modifications
119c2d
%define libvirt_sysconfig_pre() \
119c2d
    for sc in %{?*} ; do \
119c2d
        test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ; \
119c2d
        mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" "%{_sysconfdir}/sysconfig/${sc}.rpmsave.old" ; \
119c2d
    done \
119c2d
    %{nil}
119c2d
%define libvirt_sysconfig_posttrans() \
119c2d
    for sc in %{?*} ; do \
119c2d
        test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ; \
119c2d
        mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" "%{_sysconfdir}/sysconfig/${sc}" ; \
119c2d
    done \
119c2d
    %{nil}
119c2d
119c2d
Summary: Library providing a simple virtualization API
119c2d
Name: libvirt
119c2d
Version: 8.0.0
119c2d
Release: 8%{?dist}%{?extra_release}
119c2d
License: LGPLv2+
119c2d
URL: https://libvirt.org/
119c2d
119c2d
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
119c2d
    %define mainturl stable_updates/
119c2d
%endif
119c2d
Source: https://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.xz
119c2d
Source1: symlinks
119c2d
119c2d
Patch1: libvirt-RHEL-Fix-virConnectGetMaxVcpus-output.patch
119c2d
Patch2: libvirt-build-Only-install-libvirt-guests-when-building-libvirtd.patch
119c2d
Patch3: libvirt-docs-Add-man-page-for-libvirt-guests.patch
119c2d
Patch4: libvirt-remove-sysconfig-files.patch
119c2d
Patch5: libvirt-qemu-fix-inactive-snapshot-revert.patch
119c2d
Patch6: libvirt-Revert-report-error-when-virProcessGetStatInfo-is-unable-to-parse-data.patch
119c2d
Patch7: libvirt-qemuDomainSetupDisk-Initialize-targetPaths.patch
119c2d
Patch8: libvirt-qemu_command-Generate-memory-only-after-controllers.patch
119c2d
Patch9: libvirt-qemu-Validate-domain-definition-even-on-migration.patch
119c2d
Patch10: libvirt-Make-systemd-unit-ordering-more-robust.patch
119c2d
Patch11: libvirt-util-Fix-machined-servicename.patch
119c2d
Patch12: libvirt-qemu-support-firmware-descriptor-flash-mode-for-optional-NVRAM.patch
119c2d
Patch13: libvirt-nwfilter-hold-filter-update-lock-when-creating-deleting-bindings.patch
119c2d
Patch14: libvirt-qemu-lxc-remove-use-to-nwfilter-update-lock.patch
119c2d
Patch15: libvirt-qemu-support-multiqueue-for-vdpa-net-device.patch
119c2d
Patch16: libvirt-qemu-fix-hotplug-for-multiqueue-vdpa-net-device.patch
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-config-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
119c2d
%if %{with_libxl}
119c2d
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_lxc}
119c2d
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_qemu}
119c2d
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
119c2d
%endif
119c2d
# We had UML driver, but we've removed it.
119c2d
Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
119c2d
Obsoletes: libvirt-daemon-uml <= 5.0.0
119c2d
%if %{with_vbox}
119c2d
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
119c2d
%endif
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-client = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
# All build-time requirements. Run-time requirements are
119c2d
# listed against each sub-RPM
119c2d
BuildRequires: python3-docutils
119c2d
BuildRequires: gcc
119c2d
BuildRequires: meson >= 0.54.0
119c2d
BuildRequires: ninja-build
119c2d
BuildRequires: git
119c2d
BuildRequires: perl-interpreter
119c2d
BuildRequires: python3
119c2d
%if %{with_libxl}
119c2d
BuildRequires: xen-devel
119c2d
%endif
119c2d
BuildRequires: glib2-devel >= 2.56
119c2d
BuildRequires: libxml2-devel
119c2d
BuildRequires: libxslt
119c2d
BuildRequires: readline-devel
119c2d
BuildRequires: bash-completion >= 2.0
119c2d
BuildRequires: gettext
119c2d
BuildRequires: libtasn1-devel
119c2d
BuildRequires: gnutls-devel
119c2d
BuildRequires: libattr-devel
119c2d
# For pool-build probing for existing pools
119c2d
BuildRequires: libblkid-devel >= 2.17
119c2d
# for augparse, optionally used in testing
119c2d
BuildRequires: augeas
119c2d
BuildRequires: systemd-devel >= 185
119c2d
BuildRequires: libpciaccess-devel >= 0.10.9
119c2d
BuildRequires: yajl-devel
119c2d
%if %{with_sanlock}
119c2d
BuildRequires: sanlock-devel >= 2.4
119c2d
%endif
119c2d
BuildRequires: libpcap-devel >= 1.5.0
119c2d
BuildRequires: libnl3-devel
119c2d
BuildRequires: libselinux-devel
119c2d
BuildRequires: dnsmasq >= 2.41
119c2d
BuildRequires: iptables
119c2d
BuildRequires: ebtables
119c2d
BuildRequires: module-init-tools
119c2d
BuildRequires: cyrus-sasl-devel
119c2d
BuildRequires: polkit >= 0.112
119c2d
# For mount/umount in FS driver
119c2d
BuildRequires: util-linux
119c2d
%if %{with_qemu}
119c2d
# For managing ACLs
119c2d
BuildRequires: libacl-devel
119c2d
# From QEMU RPMs
119c2d
BuildRequires: /usr/bin/qemu-img
119c2d
%endif
119c2d
# For LVM drivers
119c2d
BuildRequires: lvm2
119c2d
# For pool type=iscsi
119c2d
BuildRequires: iscsi-initiator-utils
119c2d
%if %{with_storage_iscsi_direct}
119c2d
# For pool type=iscsi-direct
119c2d
BuildRequires: libiscsi-devel
119c2d
%endif
119c2d
# For disk driver
119c2d
BuildRequires: parted-devel
119c2d
# For Multipath support
119c2d
BuildRequires: device-mapper-devel
119c2d
%if %{with_storage_rbd}
119c2d
BuildRequires: librados-devel
119c2d
BuildRequires: librbd-devel
119c2d
%endif
119c2d
%if %{with_storage_gluster}
119c2d
BuildRequires: glusterfs-api-devel >= 3.4.1
119c2d
BuildRequires: glusterfs-devel >= 3.4.1
119c2d
%endif
119c2d
%if %{with_storage_sheepdog}
119c2d
BuildRequires: sheepdog
119c2d
%endif
119c2d
%if %{with_numactl}
119c2d
# For QEMU/LXC numa info
119c2d
BuildRequires: numactl-devel
119c2d
%endif
119c2d
BuildRequires: libcap-ng-devel >= 0.5.0
119c2d
%if %{with_fuse}
119c2d
BuildRequires: fuse-devel >= 2.8.6
119c2d
%endif
119c2d
%if %{with_libssh2}
119c2d
BuildRequires: libssh2-devel >= 1.3.0
119c2d
%endif
119c2d
%if %{with_netcf}
119c2d
BuildRequires: netcf-devel >= 0.2.2
119c2d
%endif
119c2d
%if %{with_esx}
119c2d
BuildRequires: libcurl-devel
119c2d
%endif
119c2d
%if %{with_hyperv}
119c2d
BuildRequires: libwsman-devel >= 2.6.3
119c2d
%endif
119c2d
BuildRequires: audit-libs-devel
119c2d
# we need /usr/sbin/dtrace
119c2d
BuildRequires: systemtap-sdt-devel
119c2d
119c2d
# For mount/umount in FS driver
119c2d
BuildRequires: util-linux
119c2d
# For showmount in FS driver (netfs discovery)
119c2d
BuildRequires: nfs-utils
119c2d
119c2d
# Fedora build root suckage
119c2d
BuildRequires: gawk
119c2d
119c2d
# For storage wiping with different algorithms
119c2d
BuildRequires: scrub
119c2d
119c2d
%if %{with_numad}
119c2d
BuildRequires: numad
119c2d
%endif
119c2d
119c2d
%if %{with_wireshark}
119c2d
BuildRequires: wireshark-devel
119c2d
%endif
119c2d
119c2d
%if %{with_libssh}
119c2d
BuildRequires: libssh-devel >= 0.7.0
119c2d
%endif
119c2d
119c2d
BuildRequires: rpcgen
119c2d
BuildRequires: libtirpc-devel
119c2d
119c2d
# Needed for the firewalld_reload macro
119c2d
%if %{with_firewalld_zone}
119c2d
BuildRequires: firewalld-filesystem
119c2d
%endif
119c2d
119c2d
%description
119c2d
Libvirt is a C toolkit to interact with the virtualization capabilities
119c2d
of recent versions of Linux (and other OSes). The main package includes
119c2d
the libvirtd server exporting the virtualization support.
119c2d
119c2d
%package docs
119c2d
Summary: API reference and website documentation
119c2d
119c2d
%description docs
119c2d
Includes the API reference for the libvirt C library, and a complete
119c2d
copy of the libvirt.org website documentation.
119c2d
119c2d
%package daemon
119c2d
Summary: Server side daemon and supporting files for libvirt library
119c2d
119c2d
# All runtime requirements for the libvirt package (runtime requrements
119c2d
# for subpackages are listed later in those subpackages)
119c2d
119c2d
# The client side, i.e. shared libs are in a subpackage
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
119c2d
# netcat is needed on the server side so that clients that have
119c2d
# libvirt < 6.9.0 can connect, but newer versions will prefer
119c2d
# virt-ssh-helper. Making this a Recommends means that it gets
119c2d
# installed by default, but can still be removed if compatibility
119c2d
# with old clients is not required
119c2d
Recommends: /usr/bin/nc
119c2d
119c2d
# for modprobe of pci devices
119c2d
Requires: module-init-tools
119c2d
119c2d
# for /sbin/ip
119c2d
Requires: iproute
119c2d
# for /sbin/tc
119c2d
Requires: iproute-tc
119c2d
119c2d
Requires: polkit >= 0.112
119c2d
%if %{with_dmidecode}
119c2d
# For virConnectGetSysinfo
119c2d
Requires: dmidecode
119c2d
%endif
119c2d
# For service management
119c2d
Requires(post): /usr/bin/systemctl
119c2d
%if %{with_numad}
119c2d
Requires: numad
119c2d
%endif
119c2d
# libvirtd depends on 'messagebus' service
119c2d
Requires: dbus
119c2d
# For uid creation during pre
119c2d
Requires(pre): shadow-utils
119c2d
# Needed by /usr/libexec/libvirt-guests.sh script.
119c2d
Requires: gettext
119c2d
119c2d
# Ensure smooth upgrades
119c2d
Obsoletes: libvirt-admin < 7.3.0
119c2d
Provides: libvirt-admin = %{version}-%{release}
119c2d
Obsoletes: libvirt-bash-completion < 7.3.0
119c2d
119c2d
%description daemon
119c2d
Server side daemon required to manage the virtualization capabilities
119c2d
of recent versions of Linux. Requires a hypervisor specific sub-RPM
119c2d
for specific drivers.
119c2d
119c2d
%package daemon-config-network
119c2d
Summary: Default configuration files for the libvirtd daemon
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
119c2d
%description daemon-config-network
119c2d
Default configuration files for setting up NAT based networking
119c2d
119c2d
%package daemon-config-nwfilter
119c2d
Summary: Network filter configuration files for the libvirtd daemon
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
119c2d
%description daemon-config-nwfilter
119c2d
Network filter configuration files for cleaning guest traffic
119c2d
119c2d
%package daemon-driver-network
119c2d
Summary: Network driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: dnsmasq >= 2.41
119c2d
Requires: iptables
119c2d
119c2d
%description daemon-driver-network
119c2d
The network driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the virtual network APIs using the Linux
119c2d
bridge capabilities.
119c2d
119c2d
119c2d
%package daemon-driver-nwfilter
119c2d
Summary: Nwfilter driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: iptables
119c2d
Requires: ebtables
119c2d
119c2d
%description daemon-driver-nwfilter
119c2d
The nwfilter driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the firewall APIs using the ebtables,
119c2d
iptables and ip6tables capabilities
119c2d
119c2d
119c2d
%package daemon-driver-nodedev
119c2d
Summary: Nodedev driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
# needed for device enumeration
119c2d
Requires: systemd >= 185
119c2d
# For managing persistent mediated devices
119c2d
Requires: mdevctl
119c2d
119c2d
%description daemon-driver-nodedev
119c2d
The nodedev driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the node device APIs using the udev
119c2d
capabilities.
119c2d
119c2d
119c2d
%package daemon-driver-interface
119c2d
Summary: Interface driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
%if %{with_netcf}
119c2d
Requires: netcf-libs >= 0.2.2
119c2d
%endif
119c2d
119c2d
%description daemon-driver-interface
119c2d
The interface driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the host network interface APIs.
119c2d
119c2d
%package daemon-driver-secret
119c2d
Summary: Secret driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
%description daemon-driver-secret
119c2d
The secret driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the secret key APIs.
119c2d
119c2d
%package daemon-driver-storage-core
119c2d
Summary: Storage driver plugin including base backends for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: nfs-utils
119c2d
# For mkfs
119c2d
Requires: util-linux
119c2d
%if %{with_qemu}
119c2d
# From QEMU RPMs
119c2d
Requires: /usr/bin/qemu-img
119c2d
%endif
119c2d
%if !%{with_storage_rbd}
119c2d
Obsoletes: libvirt-daemon-driver-storage-rbd < %{version}-%{release}
119c2d
%endif
119c2d
119c2d
%description daemon-driver-storage-core
119c2d
The storage driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the storage APIs using files, local disks, LVM, SCSI,
119c2d
iSCSI, and multipath storage.
119c2d
119c2d
%package daemon-driver-storage-logical
119c2d
Summary: Storage driver plugin for lvm volumes
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: lvm2
119c2d
119c2d
%description daemon-driver-storage-logical
119c2d
The storage driver backend adding implementation of the storage APIs for block
119c2d
volumes using lvm.
119c2d
119c2d
119c2d
%package daemon-driver-storage-disk
119c2d
Summary: Storage driver plugin for disk
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: parted
119c2d
Requires: device-mapper
119c2d
119c2d
%description daemon-driver-storage-disk
119c2d
The storage driver backend adding implementation of the storage APIs for block
119c2d
volumes using the host disks.
119c2d
119c2d
119c2d
%package daemon-driver-storage-scsi
119c2d
Summary: Storage driver plugin for local scsi devices
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
%description daemon-driver-storage-scsi
119c2d
The storage driver backend adding implementation of the storage APIs for scsi
119c2d
host devices.
119c2d
119c2d
119c2d
%package daemon-driver-storage-iscsi
119c2d
Summary: Storage driver plugin for iscsi
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: iscsi-initiator-utils
119c2d
119c2d
%description daemon-driver-storage-iscsi
119c2d
The storage driver backend adding implementation of the storage APIs for iscsi
119c2d
volumes using the host iscsi stack.
119c2d
119c2d
119c2d
%if %{with_storage_iscsi_direct}
119c2d
%package daemon-driver-storage-iscsi-direct
119c2d
Summary: Storage driver plugin for iscsi-direct
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
%description daemon-driver-storage-iscsi-direct
119c2d
The storage driver backend adding implementation of the storage APIs for iscsi
119c2d
volumes using libiscsi direct connection.
119c2d
%endif
119c2d
119c2d
119c2d
%package daemon-driver-storage-mpath
119c2d
Summary: Storage driver plugin for multipath volumes
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: device-mapper
119c2d
119c2d
%description daemon-driver-storage-mpath
119c2d
The storage driver backend adding implementation of the storage APIs for
119c2d
multipath storage using device mapper.
119c2d
119c2d
119c2d
%if %{with_storage_gluster}
119c2d
%package daemon-driver-storage-gluster
119c2d
Summary: Storage driver plugin for gluster
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
    %if 0%{?fedora}
119c2d
Requires: glusterfs-client >= 2.0.1
119c2d
    %endif
119c2d
    %if (0%{?fedora} || 0%{?with_storage_gluster})
119c2d
Requires: /usr/sbin/gluster
119c2d
    %endif
119c2d
119c2d
%description daemon-driver-storage-gluster
119c2d
The storage driver backend adding implementation of the storage APIs for gluster
119c2d
volumes using libgfapi.
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_storage_rbd}
119c2d
%package daemon-driver-storage-rbd
119c2d
Summary: Storage driver plugin for rbd
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
%description daemon-driver-storage-rbd
119c2d
The storage driver backend adding implementation of the storage APIs for rbd
119c2d
volumes using the ceph protocol.
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_storage_sheepdog}
119c2d
%package daemon-driver-storage-sheepdog
119c2d
Summary: Storage driver plugin for sheepdog
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: sheepdog
119c2d
119c2d
%description daemon-driver-storage-sheepdog
119c2d
The storage driver backend adding implementation of the storage APIs for
119c2d
sheepdog volumes using.
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_storage_zfs}
119c2d
%package daemon-driver-storage-zfs
119c2d
Summary: Storage driver plugin for ZFS
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
# Support any conforming implementation of zfs
119c2d
Requires: /sbin/zfs
119c2d
Requires: /sbin/zpool
119c2d
119c2d
%description daemon-driver-storage-zfs
119c2d
The storage driver backend adding implementation of the storage APIs for
119c2d
ZFS volumes.
119c2d
%endif
119c2d
119c2d
119c2d
%package daemon-driver-storage
119c2d
Summary: Storage driver plugin including all backends for the libvirtd daemon
119c2d
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage-disk = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage-logical = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage-scsi = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage-iscsi = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage-mpath = %{version}-%{release}
119c2d
%if %{with_storage_iscsi_direct}
119c2d
Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_storage_gluster}
119c2d
Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_storage_rbd}
119c2d
Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_storage_sheepdog}
119c2d
Requires: libvirt-daemon-driver-storage-sheepdog = %{version}-%{release}
119c2d
%endif
119c2d
%if %{with_storage_zfs}
119c2d
Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
119c2d
%endif
119c2d
119c2d
%description daemon-driver-storage
119c2d
The storage driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the storage APIs using LVM, iSCSI,
119c2d
parted and more.
119c2d
119c2d
119c2d
%if %{with_qemu}
119c2d
%package daemon-driver-qemu
119c2d
Summary: QEMU driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Requires: /usr/bin/qemu-img
119c2d
# For image compression
119c2d
Requires: gzip
119c2d
Requires: bzip2
119c2d
Requires: lzop
119c2d
Requires: xz
119c2d
Requires: systemd-container
119c2d
Requires: swtpm-tools
119c2d
119c2d
%description daemon-driver-qemu
119c2d
The qemu driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the hypervisor driver APIs using
119c2d
QEMU
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_lxc}
119c2d
%package daemon-driver-lxc
119c2d
Summary: LXC driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
# There really is a hard cross-driver dependency here
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: systemd-container
119c2d
119c2d
%description daemon-driver-lxc
119c2d
The LXC driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the hypervisor driver APIs using
119c2d
the Linux kernel
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_vbox}
119c2d
%package daemon-driver-vbox
119c2d
Summary: VirtualBox driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
119c2d
%description daemon-driver-vbox
119c2d
The vbox driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the hypervisor driver APIs using
119c2d
VirtualBox
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_libxl}
119c2d
%package daemon-driver-libxl
119c2d
Summary: Libxl driver plugin for the libvirtd daemon
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-libs = %{version}-%{release}
119c2d
Obsoletes: libvirt-daemon-driver-xen < 4.3.0
119c2d
119c2d
%description daemon-driver-libxl
119c2d
The Libxl driver plugin for the libvirtd daemon, providing
119c2d
an implementation of the hypervisor driver APIs using
119c2d
Libxl
119c2d
%endif
119c2d
119c2d
119c2d
119c2d
%if %{with_qemu_tcg}
119c2d
%package daemon-qemu
119c2d
Summary: Server side daemon & driver required to run QEMU guests
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
Requires: qemu
119c2d
119c2d
%description daemon-qemu
119c2d
Server side daemon and driver required to manage the virtualization
119c2d
capabilities of the QEMU TCG emulators
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_qemu_kvm}
119c2d
%package daemon-kvm
119c2d
Summary: Server side daemon & driver required to run KVM guests
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
Requires: qemu-kvm
119c2d
119c2d
%description daemon-kvm
119c2d
Server side daemon and driver required to manage the virtualization
119c2d
capabilities of the KVM hypervisor
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_lxc}
119c2d
%package daemon-lxc
119c2d
Summary: Server side daemon & driver required to run LXC guests
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
119c2d
%description daemon-lxc
119c2d
Server side daemon and driver required to manage the virtualization
119c2d
capabilities of LXC
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_libxl}
119c2d
%package daemon-xen
119c2d
Summary: Server side daemon & driver required to run XEN guests
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
    %if %{with_libxl}
119c2d
Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
119c2d
    %endif
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
Requires: xen
119c2d
119c2d
%description daemon-xen
119c2d
Server side daemon and driver required to manage the virtualization
119c2d
capabilities of XEN
119c2d
%endif
119c2d
119c2d
%if %{with_vbox}
119c2d
%package daemon-vbox
119c2d
Summary: Server side daemon & driver required to run VirtualBox guests
119c2d
119c2d
Requires: libvirt-daemon = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
119c2d
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
119c2d
119c2d
%description daemon-vbox
119c2d
Server side daemon and driver required to manage the virtualization
119c2d
capabilities of VirtualBox
119c2d
%endif
119c2d
119c2d
%package client
119c2d
Summary: Client side utilities of the libvirt library
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
# Needed by virt-pki-validate script.
119c2d
Requires: gnutls-utils
119c2d
119c2d
# Ensure smooth upgrades
119c2d
Obsoletes: libvirt-bash-completion < 7.3.0
119c2d
119c2d
%description client
119c2d
The client binaries needed to access the virtualization
119c2d
capabilities of recent versions of Linux (and other OSes).
119c2d
119c2d
%package libs
119c2d
Summary: Client side libraries
119c2d
# So remote clients can access libvirt over SSH tunnel
119c2d
Requires: cyrus-sasl
119c2d
# Needed by default sasl.conf - no onerous extra deps, since
119c2d
# 100's of other things on a system already pull in krb5-libs
119c2d
Requires: cyrus-sasl-gssapi
119c2d
119c2d
%description libs
119c2d
Shared libraries for accessing the libvirt daemon.
119c2d
119c2d
%if %{with_wireshark}
119c2d
%package wireshark
119c2d
Summary: Wireshark dissector plugin for libvirt RPC transactions
119c2d
Requires: wireshark
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
119c2d
%description wireshark
119c2d
Wireshark dissector plugin for better analysis of libvirt RPC traffic.
119c2d
%endif
119c2d
119c2d
%if %{with_lxc}
119c2d
%package login-shell
119c2d
Summary: Login shell for connecting users to an LXC container
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
119c2d
%description login-shell
119c2d
Provides the set-uid virt-login-shell binary that is used to
119c2d
connect a user to an LXC container when they login, by switching
119c2d
namespaces.
119c2d
%endif
119c2d
119c2d
%package devel
119c2d
Summary: Libraries, includes, etc. to compile with the libvirt library
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
Requires: pkgconfig
119c2d
119c2d
%description devel
119c2d
Include header files & development libraries for the libvirt C library.
119c2d
119c2d
%if %{with_sanlock}
119c2d
%package lock-sanlock
119c2d
Summary: Sanlock lock manager plugin for QEMU driver
119c2d
Requires: sanlock >= 2.4
119c2d
#for virt-sanlock-cleanup require augeas
119c2d
Requires: augeas
119c2d
Requires: %{name}-daemon = %{version}-%{release}
119c2d
Requires: %{name}-libs = %{version}-%{release}
119c2d
119c2d
%description lock-sanlock
119c2d
Includes the Sanlock lock manager plugin for the QEMU
119c2d
driver
119c2d
%endif
119c2d
119c2d
%package nss
119c2d
Summary: Libvirt plugin for Name Service Switch
119c2d
Requires: libvirt-daemon-driver-network = %{version}-%{release}
119c2d
119c2d
%description nss
119c2d
Libvirt plugin for NSS for translating domain names into IP addresses.
119c2d
119c2d
119c2d
%prep
119c2d
119c2d
%autosetup -S git_am -N
119c2d
119c2d
# "make dist" replaces all symlinks with a copy of the linked files;
119c2d
# we need to replace all of them with the original symlinks
119c2d
echo "Restoring symlinks"
119c2d
while read lnk target; do
119c2d
    if [ -e $lnk ]; then
119c2d
        rm -rf $lnk
119c2d
        ln -s $target $lnk
119c2d
    fi
119c2d
done <%{_sourcedir}/symlinks || exit 1
119c2d
git add .
119c2d
git commit -q -a --allow-empty --author 'rpm-build <rpm-build>' -m symlinks
119c2d
119c2d
119c2d
git config gc.auto 0
119c2d
119c2d
%autopatch
119c2d
119c2d
%build
119c2d
%if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel}
119c2d
    %define supported_platform 1
119c2d
%else
119c2d
    %define supported_platform 0
119c2d
%endif
119c2d
119c2d
%if ! %{supported_platform}
119c2d
echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
119c2d
exit 1
119c2d
%endif
119c2d
119c2d
%if %{with_qemu}
119c2d
    %define arg_qemu -Ddriver_qemu=enabled
119c2d
%else
119c2d
    %define arg_qemu -Ddriver_qemu=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_openvz}
119c2d
    %define arg_openvz -Ddriver_openvz=enabled
119c2d
%else
119c2d
    %define arg_openvz -Ddriver_openvz=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_lxc}
119c2d
    %define arg_lxc -Ddriver_lxc=enabled
119c2d
    %define arg_login_shell -Dlogin_shell=enabled
119c2d
%else
119c2d
    %define arg_lxc -Ddriver_lxc=disabled
119c2d
    %define arg_login_shell -Dlogin_shell=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_vbox}
119c2d
    %define arg_vbox -Ddriver_vbox=enabled
119c2d
%else
119c2d
    %define arg_vbox -Ddriver_vbox=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_libxl}
119c2d
    %define arg_libxl -Ddriver_libxl=enabled
119c2d
%else
119c2d
    %define arg_libxl -Ddriver_libxl=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_esx}
119c2d
    %define arg_esx -Ddriver_esx=enabled -Dcurl=enabled
119c2d
%else
119c2d
    %define arg_esx -Ddriver_esx=disabled -Dcurl=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_hyperv}
119c2d
    %define arg_hyperv -Ddriver_hyperv=enabled -Dopenwsman=enabled
119c2d
%else
119c2d
    %define arg_hyperv -Ddriver_hyperv=disabled -Dopenwsman=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_vmware}
119c2d
    %define arg_vmware -Ddriver_vmware=enabled
119c2d
%else
119c2d
    %define arg_vmware -Ddriver_vmware=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_storage_rbd}
119c2d
    %define arg_storage_rbd -Dstorage_rbd=enabled
119c2d
%else
119c2d
    %define arg_storage_rbd -Dstorage_rbd=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_storage_sheepdog}
119c2d
    %define arg_storage_sheepdog -Dstorage_sheepdog=enabled
119c2d
%else
119c2d
    %define arg_storage_sheepdog -Dstorage_sheepdog=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_storage_gluster}
119c2d
    %define arg_storage_gluster -Dstorage_gluster=enabled -Dglusterfs=enabled
119c2d
%else
119c2d
    %define arg_storage_gluster -Dstorage_gluster=disabled -Dglusterfs=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_storage_zfs}
119c2d
    %define arg_storage_zfs -Dstorage_zfs=enabled
119c2d
%else
119c2d
    %define arg_storage_zfs -Dstorage_zfs=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_numactl}
119c2d
    %define arg_numactl -Dnumactl=enabled
119c2d
%else
119c2d
    %define arg_numactl -Dnumactl=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_numad}
119c2d
    %define arg_numad -Dnumad=enabled
119c2d
%else
119c2d
    %define arg_numad -Dnumad=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_fuse}
119c2d
    %define arg_fuse -Dfuse=enabled
119c2d
%else
119c2d
    %define arg_fuse -Dfuse=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_sanlock}
119c2d
    %define arg_sanlock -Dsanlock=enabled
119c2d
%else
119c2d
    %define arg_sanlock -Dsanlock=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_firewalld_zone}
119c2d
    %define arg_firewalld_zone -Dfirewalld_zone=enabled
119c2d
%else
119c2d
    %define arg_firewalld_zone -Dfirewalld_zone=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_netcf}
119c2d
    %define arg_netcf -Dnetcf=enabled
119c2d
%else
119c2d
    %define arg_netcf -Dnetcf=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_wireshark}
119c2d
    %define arg_wireshark -Dwireshark_dissector=enabled
119c2d
%else
119c2d
    %define arg_wireshark -Dwireshark_dissector=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_storage_iscsi_direct}
119c2d
    %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=enabled -Dlibiscsi=enabled
119c2d
%else
119c2d
    %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled -Dlibiscsi=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_libssh}
119c2d
    %define arg_libssh -Dlibssh=enabled
119c2d
%else
119c2d
    %define arg_libssh -Dlibssh=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_libssh2}
119c2d
    %define arg_libssh2 -Dlibssh2=enabled
119c2d
%else
119c2d
    %define arg_libssh2 -Dlibssh2=disabled
119c2d
%endif
119c2d
119c2d
%if %{with_modular_daemons}
119c2d
    %define arg_remote_mode -Dremote_default_mode=direct
119c2d
%else
119c2d
    %define arg_remote_mode -Dremote_default_mode=legacy
119c2d
%endif
119c2d
119c2d
%define when  %(date +"%%F-%%T")
119c2d
%define where %(hostname)
119c2d
%define who   %{?packager}%{!?packager:Unknown}
119c2d
%define arg_packager -Dpackager="%{who}, %{when}, %{where}"
119c2d
%define arg_packager_version -Dpackager_version="%{release}"
119c2d
119c2d
%define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux"
119c2d
119c2d
# place macros above and build commands below this comment
119c2d
119c2d
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
119c2d
119c2d
%meson \
119c2d
           -Drunstatedir=%{_rundir} \
119c2d
           %{?arg_qemu} \
119c2d
           %{?arg_openvz} \
119c2d
           %{?arg_lxc} \
119c2d
           %{?arg_vbox} \
119c2d
           %{?arg_libxl} \
119c2d
           -Dsasl=enabled \
119c2d
           -Dpolkit=enabled \
119c2d
           -Ddriver_libvirtd=enabled \
119c2d
           -Ddriver_remote=enabled \
119c2d
           -Ddriver_test=enabled \
119c2d
           %{?arg_esx} \
119c2d
           %{?arg_hyperv} \
119c2d
           %{?arg_vmware} \
119c2d
           -Ddriver_vz=disabled \
119c2d
           -Ddriver_bhyve=disabled \
119c2d
           -Ddriver_ch=disabled \
119c2d
           %{?arg_remote_mode} \
119c2d
           -Ddriver_interface=enabled \
119c2d
           -Ddriver_network=enabled \
119c2d
           -Dstorage_fs=enabled \
119c2d
           -Dstorage_lvm=enabled \
119c2d
           -Dstorage_iscsi=enabled \
119c2d
           %{?arg_storage_iscsi_direct} \
119c2d
           -Dstorage_scsi=enabled \
119c2d
           -Dstorage_disk=enabled \
119c2d
           -Dstorage_mpath=enabled \
119c2d
           %{?arg_storage_rbd} \
119c2d
           %{?arg_storage_sheepdog} \
119c2d
           %{?arg_storage_gluster} \
119c2d
           %{?arg_storage_zfs} \
119c2d
           -Dstorage_vstorage=disabled \
119c2d
           %{?arg_numactl} \
119c2d
           %{?arg_numad} \
119c2d
           -Dcapng=enabled \
119c2d
           %{?arg_fuse} \
119c2d
           %{?arg_netcf} \
119c2d
           -Dselinux=enabled \
119c2d
           %{?arg_selinux_mount} \
119c2d
           -Dapparmor=disabled \
119c2d
           -Dapparmor_profiles=disabled \
119c2d
           -Dsecdriver_apparmor=disabled \
119c2d
           -Dudev=enabled \
119c2d
           -Dyajl=enabled \
119c2d
           %{?arg_sanlock} \
119c2d
           -Dlibpcap=enabled \
119c2d
           -Dlibnl=enabled \
119c2d
           -Daudit=enabled \
119c2d
           -Ddtrace=enabled \
119c2d
           -Dfirewalld=enabled \
119c2d
           %{?arg_firewalld_zone} \
119c2d
           %{?arg_wireshark} \
119c2d
           %{?arg_libssh} \
119c2d
           %{?arg_libssh2} \
119c2d
           -Dpm_utils=disabled \
119c2d
           -Dnss=enabled \
119c2d
           %{arg_packager} \
119c2d
           %{arg_packager_version} \
119c2d
           -Dqemu_user=%{qemu_user} \
119c2d
           -Dqemu_group=%{qemu_group} \
119c2d
           -Dqemu_moddir=%{qemu_moddir} \
119c2d
           -Dqemu_datadir=%{qemu_datadir} \
119c2d
           -Dtls_priority=%{tls_priority} \
119c2d
           %{?enable_werror} \
119c2d
           -Dexpensive_tests=enabled \
119c2d
           -Dinit_script=systemd \
119c2d
           -Ddocs=enabled \
119c2d
           -Dtests=enabled \
119c2d
           -Drpath=disabled \
119c2d
           %{?arg_login_shell}
119c2d
119c2d
%meson_build
119c2d
119c2d
%install
119c2d
rm -fr %{buildroot}
119c2d
119c2d
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
119c2d
119c2d
%meson_install
119c2d
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.la
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-backend/*.a
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.la
119c2d
rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/storage-file/*.a
119c2d
%if %{with_wireshark}
119c2d
rm -f $RPM_BUILD_ROOT%{wireshark_plugindir}/libvirt.la
119c2d
%endif
119c2d
119c2d
# We don't want to install /etc/libvirt/qemu/networks in the main %%files list
119c2d
# because if the admin wants to delete the default network completely, we don't
119c2d
# want to end up re-incarnating it on every RPM upgrade.
119c2d
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
119c2d
cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
119c2d
   $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
119c2d
# libvirt saves this file with mode 0600
119c2d
chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
119c2d
119c2d
# nwfilter files are installed in /usr/share/libvirt and copied to /etc in %%post
119c2d
# to avoid verification errors on changed files in /etc
119c2d
install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
119c2d
cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
119c2d
    $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
119c2d
# libvirt saves these files with mode 600
119c2d
chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
119c2d
119c2d
%if ! %{with_qemu}
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
119c2d
%endif
119c2d
%find_lang %{name}
119c2d
119c2d
%if ! %{with_sanlock}
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
119c2d
%endif
119c2d
119c2d
%if ! %{with_lxc}
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
119c2d
%endif
119c2d
119c2d
%if ! %{with_qemu}
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
119c2d
%endif
119c2d
%if ! %{with_lxc}
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
119c2d
%endif
119c2d
%if ! %{with_libxl}
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
119c2d
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
119c2d
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
119c2d
%endif
119c2d
119c2d
# Copied into libvirt-docs subpackage eventually
119c2d
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
119c2d
119c2d
%ifarch %{arches_systemtap_64bit}
119c2d
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
119c2d
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
119c2d
119c2d
    %if %{with_qemu}
119c2d
mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
119c2d
   $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
119c2d
    %endif
119c2d
%endif
119c2d
119c2d
%check
119c2d
# Building on slow archs, like emulated s390x in Fedora copr, requires
119c2d
# raising the test timeout
119c2d
VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10
119c2d
119c2d
%define libvirt_daemon_schedule_restart() mkdir -p %{_localstatedir}/lib/rpm-state/libvirt || : \
119c2d
/bin/systemctl is-active %1.service 1>/dev/null 2>&1 && \
119c2d
  touch %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 || :
119c2d
119c2d
%define libvirt_daemon_finish_restart() rm -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1 \
119c2d
rmdir %{_localstatedir}/lib/rpm-state/libvirt 2>/dev/null || :
119c2d
119c2d
%define libvirt_daemon_needs_restart() -f %{_localstatedir}/lib/rpm-state/libvirt/restart-%1
119c2d
119c2d
%define libvirt_daemon_perform_restart() if test %libvirt_daemon_needs_restart %1 \
119c2d
then \
119c2d
  /bin/systemctl try-restart %1.service >/dev/null 2>&1 || : \
119c2d
fi \
119c2d
%libvirt_daemon_finish_restart %1
119c2d
119c2d
# For daemons with only UNIX sockets
119c2d
%define libvirt_daemon_systemd_post() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1.service
119c2d
%define libvirt_daemon_systemd_preun() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1.socket
119c2d
119c2d
# For daemons with UNIX and INET sockets
119c2d
%define libvirt_daemon_systemd_post_inet() %systemd_post %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.service
119c2d
%define libvirt_daemon_systemd_preun_inet() %systemd_preun %1.service %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket %1.socket
119c2d
119c2d
# For daemons with only UNIX sockets and no unprivileged read-only access
119c2d
%define libvirt_daemon_systemd_post_priv() %systemd_post %1.socket %1-admin.socket %1.service
119c2d
%define libvirt_daemon_systemd_preun_priv() %systemd_preun %1.service %1-admin.socket %1.socket
119c2d
119c2d
%pre daemon
119c2d
%libvirt_sysconfig_pre libvirtd virtproxyd virtlogd virtlockd libvirt-guests
119c2d
# 'libvirt' group is just to allow password-less polkit access to
119c2d
# libvirtd. The uid number is irrelevant, so we use dynamic allocation
119c2d
# described at the above link.
119c2d
getent group libvirt >/dev/null || groupadd -r libvirt
119c2d
119c2d
exit 0
119c2d
119c2d
%post daemon
119c2d
%libvirt_daemon_systemd_post_priv virtlogd
119c2d
%libvirt_daemon_systemd_post_priv virtlockd
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post_inet virtproxyd
119c2d
%else
119c2d
%libvirt_daemon_systemd_post_inet libvirtd
119c2d
%endif
119c2d
119c2d
%systemd_post libvirt-guests.service
119c2d
119c2d
%libvirt_daemon_schedule_restart libvirtd
119c2d
119c2d
%preun daemon
119c2d
%systemd_preun libvirt-guests.service
119c2d
119c2d
%libvirt_daemon_systemd_preun_inet libvirtd
119c2d
%libvirt_daemon_systemd_preun_inet virtproxyd
119c2d
%libvirt_daemon_systemd_preun_priv virtlogd
119c2d
%libvirt_daemon_systemd_preun_priv virtlockd
119c2d
119c2d
%postun daemon
119c2d
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
119c2d
if [ $1 -ge 1 ] ; then
119c2d
    /bin/systemctl reload-or-try-restart virtlockd.service virtlogd.service >/dev/null 2>&1 || :
119c2d
fi
119c2d
%systemd_postun libvirt-guests.service
119c2d
119c2d
# In upgrade scenario we must explicitly enable virtlockd/virtlogd
119c2d
# sockets, if libvirtd is already enabled and start them if
119c2d
# libvirtd is running, otherwise you'll get failures to start
119c2d
# guests
119c2d
%triggerpostun daemon -- libvirt-daemon < 1.3.0
119c2d
if [ $1 -ge 1 ] ; then
119c2d
    /bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 &&
119c2d
        /bin/systemctl enable virtlogd.socket virtlogd-admin.socket || :
119c2d
    /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 &&
119c2d
        /bin/systemctl start virtlogd.socket virtlogd-admin.socket || :
119c2d
fi
119c2d
119c2d
%posttrans daemon
119c2d
%libvirt_sysconfig_posttrans libvirtd virtproxyd virtlogd virtlockd libvirt-guests
119c2d
if test %libvirt_daemon_needs_restart libvirtd
119c2d
then
119c2d
    # See if user has previously modified their install to
119c2d
    # tell libvirtd to use --listen
119c2d
    grep -E '^LIBVIRTD_ARGS=.*--listen' /etc/sysconfig/libvirtd 1>/dev/null 2>&1
119c2d
    if test $? = 0
119c2d
    then
119c2d
        # Then lets keep honouring --listen and *not* use
119c2d
        # systemd socket activation, because switching things
119c2d
        # might confuse mgmt tool like puppet/ansible that
119c2d
        # expect the old style libvirtd
119c2d
        /bin/systemctl mask \
119c2d
                libvirtd.socket \
119c2d
                libvirtd-ro.socket \
119c2d
                libvirtd-admin.socket \
119c2d
                libvirtd-tls.socket \
119c2d
                libvirtd-tcp.socket >/dev/null 2>&1 || :
119c2d
    else
119c2d
        # Old libvirtd owns the sockets and will delete them on
119c2d
        # shutdown. Can't use a try-restart as libvirtd will simply
119c2d
        # own the sockets again when it comes back up. Thus we must
119c2d
        # do this particular ordering, so that we get libvirtd
119c2d
        # running with socket activation in use
119c2d
        /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1
119c2d
        if test $? = 0
119c2d
        then
119c2d
            /bin/systemctl stop libvirtd.service >/dev/null 2>&1 || :
119c2d
119c2d
            /bin/systemctl try-restart \
119c2d
                    libvirtd.socket \
119c2d
                    libvirtd-ro.socket \
119c2d
                    libvirtd-admin.socket >/dev/null 2>&1 || :
119c2d
119c2d
            /bin/systemctl start libvirtd.service >/dev/null 2>&1 || :
119c2d
        fi
119c2d
    fi
119c2d
fi
119c2d
119c2d
%libvirt_daemon_finish_restart libvirtd
119c2d
119c2d
%pre daemon-driver-network
119c2d
%libvirt_sysconfig_pre virtnetworkd
119c2d
119c2d
%post daemon-driver-network
119c2d
%if %{with_firewalld_zone}
119c2d
    %firewalld_reload
119c2d
%endif
119c2d
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtnetworkd
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtnetworkd
119c2d
119c2d
%preun daemon-driver-network
119c2d
%libvirt_daemon_systemd_preun virtnetworkd
119c2d
119c2d
%postun daemon-driver-network
119c2d
%if %{with_firewalld_zone}
119c2d
    %firewalld_reload
119c2d
%endif
119c2d
119c2d
%posttrans daemon-driver-network
119c2d
%libvirt_sysconfig_posttrans virtnetworkd
119c2d
%libvirt_daemon_perform_restart virtnetworkd
119c2d
119c2d
%pre daemon-driver-nwfilter
119c2d
%libvirt_sysconfig_pre virtnwfilterd
119c2d
119c2d
%post daemon-driver-nwfilter
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtnwfilterd
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtnwfilterd
119c2d
119c2d
%preun daemon-driver-nwfilter
119c2d
%libvirt_daemon_systemd_preun virtnwfilterd
119c2d
119c2d
%posttrans daemon-driver-nwfilter
119c2d
%libvirt_sysconfig_posttrans virtnwfilterd
119c2d
%libvirt_daemon_perform_restart virtnwfilterd
119c2d
119c2d
%pre daemon-driver-nodedev
119c2d
%libvirt_sysconfig_pre virtnodedevd
119c2d
119c2d
%post daemon-driver-nodedev
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtnodedevd
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtnodedevd
119c2d
119c2d
%preun daemon-driver-nodedev
119c2d
%libvirt_daemon_systemd_preun virtnodedevd
119c2d
119c2d
%posttrans daemon-driver-nodedev
119c2d
%libvirt_sysconfig_posttrans virtnodedevd
119c2d
%libvirt_daemon_perform_restart virtnodedevd
119c2d
119c2d
%pre daemon-driver-interface
119c2d
%libvirt_sysconfig_pre virtinterfaced
119c2d
119c2d
%post daemon-driver-interface
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtinterfaced
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtinterfaced
119c2d
119c2d
%preun daemon-driver-interface
119c2d
%libvirt_daemon_systemd_preun virtinterfaced
119c2d
119c2d
%posttrans daemon-driver-interface
119c2d
%libvirt_sysconfig_posttrans virtinterfaced
119c2d
%libvirt_daemon_perform_restart virtinterfaced
119c2d
119c2d
%pre daemon-driver-secret
119c2d
%libvirt_sysconfig_pre virtsecretd
119c2d
119c2d
%post daemon-driver-secret
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtsecretd
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtsecretd
119c2d
119c2d
%preun daemon-driver-secret
119c2d
%libvirt_daemon_systemd_preun virtsecretd
119c2d
119c2d
%posttrans daemon-driver-secret
119c2d
%libvirt_sysconfig_posttrans virtsecretd
119c2d
%libvirt_daemon_perform_restart virtsecretd
119c2d
119c2d
119c2d
%pre daemon-driver-storage-core
119c2d
%libvirt_sysconfig_pre virtstoraged
119c2d
119c2d
%post daemon-driver-storage-core
119c2d
%if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtstoraged
119c2d
%endif
119c2d
%libvirt_daemon_schedule_restart virtstoraged
119c2d
119c2d
%preun daemon-driver-storage-core
119c2d
%libvirt_daemon_systemd_preun virtstoraged
119c2d
119c2d
%posttrans daemon-driver-storage-core
119c2d
%libvirt_sysconfig_posttrans virtstoraged
119c2d
%libvirt_daemon_perform_restart virtstoraged
119c2d
119c2d
119c2d
%if %{with_qemu}
119c2d
%pre daemon-driver-qemu
119c2d
%libvirt_sysconfig_pre virtqemud
119c2d
# We want soft static allocation of well-known ids, as disk images
119c2d
# are commonly shared across NFS mounts by id rather than name; see
119c2d
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
119c2d
getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
119c2d
getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
119c2d
if ! getent passwd qemu >/dev/null; then
119c2d
  if ! getent passwd 107 >/dev/null; then
119c2d
    useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
119c2d
  else
119c2d
    useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
119c2d
  fi
119c2d
fi
119c2d
exit 0
119c2d
119c2d
%post daemon-driver-qemu
119c2d
    %if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtqemud
119c2d
    %endif
119c2d
%libvirt_daemon_schedule_restart virtqemud
119c2d
119c2d
%preun daemon-driver-qemu
119c2d
%libvirt_daemon_systemd_preun virtqemud
119c2d
119c2d
%posttrans daemon-driver-qemu
119c2d
%libvirt_sysconfig_posttrans virtqemud
119c2d
%libvirt_daemon_perform_restart virtqemud
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_lxc}
119c2d
%pre daemon-driver-lxc
119c2d
%libvirt_sysconfig_pre virtlxcd
119c2d
119c2d
%post daemon-driver-lxc
119c2d
    %if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtlxcd
119c2d
    %endif
119c2d
%libvirt_daemon_schedule_restart virtlxcd
119c2d
119c2d
%preun daemon-driver-lxc
119c2d
%libvirt_daemon_systemd_preun virtlxcd
119c2d
119c2d
%posttrans daemon-driver-lxc
119c2d
%libvirt_sysconfig_posttrans virtlxcd
119c2d
%libvirt_daemon_perform_restart virtlxcd
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_vbox}
119c2d
%post daemon-driver-vbox
119c2d
    %if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtvboxd
119c2d
    %endif
119c2d
%libvirt_daemon_schedule_restart virtvboxd
119c2d
119c2d
%pre daemon-driver-vbox
119c2d
%libvirt_sysconfig_pre virtvboxd
119c2d
119c2d
%preun daemon-driver-vbox
119c2d
%libvirt_daemon_systemd_preun virtvboxd
119c2d
119c2d
%posttrans daemon-driver-vbox
119c2d
%libvirt_sysconfig_posttrans virtvboxd
119c2d
%libvirt_daemon_perform_restart virtvboxd
119c2d
%endif
119c2d
119c2d
119c2d
%if %{with_libxl}
119c2d
%post daemon-driver-libxl
119c2d
    %if %{with_modular_daemons}
119c2d
%libvirt_daemon_systemd_post virtxend
119c2d
    %endif
119c2d
%libvirt_daemon_schedule_restart virtxend
119c2d
119c2d
%pre daemon-driver-libxl
119c2d
%libvirt_sysconfig_pre virtxend
119c2d
119c2d
%preun daemon-driver-libxl
119c2d
%libvirt_daemon_systemd_preun virtxend
119c2d
119c2d
%posttrans daemon-driver-libxl
119c2d
%libvirt_sysconfig_posttrans virtxend
119c2d
%libvirt_daemon_perform_restart virtxend
119c2d
%endif
119c2d
119c2d
119c2d
%post daemon-config-network
119c2d
if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
119c2d
    # see if the network used by default network creates a conflict,
119c2d
    # and try to resolve it
119c2d
    # NB: 192.168.122.0/24 is used in the default.xml template file;
119c2d
    # do not modify any of those values here without also modifying
119c2d
    # them in the template.
119c2d
    orig_sub=122
119c2d
    sub=${orig_sub}
119c2d
    nl='
119c2d
'
119c2d
    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
119c2d
    case ${routes} in
119c2d
      *"${nl}192.168.${orig_sub}.0/24${nl}"*)
119c2d
        # there was a match, so we need to look for an unused subnet
119c2d
        for new_sub in $(seq 124 254); do
119c2d
          case ${routes} in
119c2d
          *"${nl}192.168.${new_sub}.0/24${nl}"*)
119c2d
            ;;
119c2d
          *)
119c2d
            sub=$new_sub
119c2d
            break;
119c2d
            ;;
119c2d
          esac
119c2d
        done
119c2d
        ;;
119c2d
      *)
119c2d
        ;;
119c2d
    esac
119c2d
119c2d
    sed -e "s/${orig_sub}/${sub}/g" \
119c2d
         < %{_datadir}/libvirt/networks/default.xml \
119c2d
         > %{_sysconfdir}/libvirt/qemu/networks/default.xml
119c2d
    ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
119c2d
    # libvirt saves this file with mode 0600
119c2d
    chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
119c2d
119c2d
    # Make sure libvirt picks up the new network defininiton
119c2d
    %libvirt_daemon_schedule_restart libvirtd
119c2d
    %libvirt_daemon_schedule_restart virtnetworkd
119c2d
fi
119c2d
119c2d
%posttrans daemon-config-network
119c2d
%libvirt_daemon_perform_restart libvirtd
119c2d
%libvirt_daemon_perform_restart virtnetworkd
119c2d
119c2d
%post daemon-config-nwfilter
119c2d
for datadir_file in %{_datadir}/libvirt/nwfilter/*.xml; do
119c2d
  sysconfdir_file=%{_sysconfdir}/libvirt/nwfilter/$(basename "$datadir_file")
119c2d
  if [ ! -f "$sysconfdir_file" ]; then
119c2d
    # libvirt saves these files with mode 600
119c2d
    install -m 0600 "$datadir_file" "$sysconfdir_file"
119c2d
  fi
119c2d
done
119c2d
# Make sure libvirt picks up the new nwfilter defininitons
119c2d
%libvirt_daemon_schedule_restart libvirtd
119c2d
%libvirt_daemon_schedule_restart virtnwfilterd
119c2d
119c2d
%posttrans daemon-config-nwfilter
119c2d
%libvirt_daemon_perform_restart libvirtd
119c2d
%libvirt_daemon_perform_restart virtnwfilterd
119c2d
119c2d
%if %{with_lxc}
119c2d
%pre login-shell
119c2d
getent group virtlogin >/dev/null || groupadd -r virtlogin
119c2d
exit 0
119c2d
%endif
119c2d
119c2d
%files
119c2d
119c2d
%files docs
119c2d
%doc AUTHORS.rst NEWS.rst README.rst
119c2d
%doc libvirt-docs/*
119c2d
119c2d
%files daemon
119c2d
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
119c2d
119c2d
%{_unitdir}/libvirtd.service
119c2d
%{_unitdir}/libvirtd.socket
119c2d
%{_unitdir}/libvirtd-ro.socket
119c2d
%{_unitdir}/libvirtd-admin.socket
119c2d
%{_unitdir}/libvirtd-tcp.socket
119c2d
%{_unitdir}/libvirtd-tls.socket
119c2d
%{_unitdir}/virtproxyd.service
119c2d
%{_unitdir}/virtproxyd.socket
119c2d
%{_unitdir}/virtproxyd-ro.socket
119c2d
%{_unitdir}/virtproxyd-admin.socket
119c2d
%{_unitdir}/virtproxyd-tcp.socket
119c2d
%{_unitdir}/virtproxyd-tls.socket
119c2d
%{_unitdir}/virt-guest-shutdown.target
119c2d
%{_unitdir}/virtlogd.service
119c2d
%{_unitdir}/virtlogd.socket
119c2d
%{_unitdir}/virtlogd-admin.socket
119c2d
%{_unitdir}/virtlockd.service
119c2d
%{_unitdir}/virtlockd.socket
119c2d
%{_unitdir}/virtlockd-admin.socket
119c2d
%{_unitdir}/libvirt-guests.service
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
119c2d
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
119c2d
%config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
119c2d
119c2d
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
119c2d
%dir %{_datadir}/libvirt/
119c2d
119c2d
%ghost %dir %{_rundir}/libvirt/
119c2d
119c2d
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
119c2d
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
119c2d
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
119c2d
%dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
119c2d
119c2d
119c2d
%dir %attr(0755, root, root) %{_libdir}/libvirt/
119c2d
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
119c2d
%dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver
119c2d
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
119c2d
119c2d
%{_datadir}/augeas/lenses/libvirtd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirtd.aug
119c2d
%{_datadir}/augeas/lenses/virtlogd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtlogd.aug
119c2d
%{_datadir}/augeas/lenses/virtlockd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtlockd.aug
119c2d
%{_datadir}/augeas/lenses/virtproxyd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtproxyd.aug
119c2d
%{_datadir}/augeas/lenses/libvirt_lockd.aug
119c2d
%if %{with_qemu}
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
119c2d
%endif
119c2d
119c2d
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
119c2d
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
119c2d
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
119c2d
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
119c2d
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
119c2d
119c2d
%attr(0755, root, root) %{_bindir}/virt-ssh-helper
119c2d
119c2d
%attr(0755, root, root) %{_sbindir}/libvirtd
119c2d
%attr(0755, root, root) %{_sbindir}/virtproxyd
119c2d
%attr(0755, root, root) %{_sbindir}/virtlogd
119c2d
%attr(0755, root, root) %{_sbindir}/virtlockd
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
119c2d
119c2d
%{_mandir}/man1/virt-admin.1*
119c2d
%{_mandir}/man1/virt-host-validate.1*
119c2d
%{_mandir}/man8/virt-ssh-helper.8*
119c2d
%{_mandir}/man8/libvirt-guests.8*
119c2d
%{_mandir}/man8/libvirtd.8*
119c2d
%{_mandir}/man8/virtlogd.8*
119c2d
%{_mandir}/man8/virtlockd.8*
119c2d
%{_mandir}/man8/virtproxyd.8*
119c2d
%{_mandir}/man7/virkey*.7*
119c2d
119c2d
%{_bindir}/virt-host-validate
119c2d
%{_bindir}/virt-admin
119c2d
%{_datadir}/bash-completion/completions/virt-admin
119c2d
119c2d
%files daemon-config-network
119c2d
%dir %{_datadir}/libvirt/networks/
119c2d
%{_datadir}/libvirt/networks/default.xml
119c2d
%ghost %{_sysconfdir}/libvirt/qemu/networks/default.xml
119c2d
%ghost %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
119c2d
119c2d
%files daemon-config-nwfilter
119c2d
%dir %{_datadir}/libvirt/nwfilter/
119c2d
%{_datadir}/libvirt/nwfilter/*.xml
119c2d
%ghost %{_sysconfdir}/libvirt/nwfilter/*.xml
119c2d
119c2d
%files daemon-driver-interface
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtinterfaced.conf
119c2d
%{_datadir}/augeas/lenses/virtinterfaced.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtinterfaced.aug
119c2d
%{_unitdir}/virtinterfaced.service
119c2d
%{_unitdir}/virtinterfaced.socket
119c2d
%{_unitdir}/virtinterfaced-ro.socket
119c2d
%{_unitdir}/virtinterfaced-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtinterfaced
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
119c2d
%{_mandir}/man8/virtinterfaced.8*
119c2d
119c2d
%files daemon-driver-network
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf
119c2d
%{_datadir}/augeas/lenses/virtnetworkd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug
119c2d
%{_unitdir}/virtnetworkd.service
119c2d
%{_unitdir}/virtnetworkd.socket
119c2d
%{_unitdir}/virtnetworkd-ro.socket
119c2d
%{_unitdir}/virtnetworkd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtnetworkd
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
119c2d
%ghost %dir %{_rundir}/libvirt/network/
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
119c2d
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
119c2d
%{_mandir}/man8/virtnetworkd.8*
119c2d
119c2d
%if %{with_firewalld_zone}
119c2d
%{_prefix}/lib/firewalld/zones/libvirt.xml
119c2d
%endif
119c2d
119c2d
%files daemon-driver-nodedev
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtnodedevd.conf
119c2d
%{_datadir}/augeas/lenses/virtnodedevd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtnodedevd.aug
119c2d
%{_unitdir}/virtnodedevd.service
119c2d
%{_unitdir}/virtnodedevd.socket
119c2d
%{_unitdir}/virtnodedevd-ro.socket
119c2d
%{_unitdir}/virtnodedevd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtnodedevd
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so
119c2d
%{_mandir}/man8/virtnodedevd.8*
119c2d
119c2d
%files daemon-driver-nwfilter
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtnwfilterd.conf
119c2d
%{_datadir}/augeas/lenses/virtnwfilterd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtnwfilterd.aug
119c2d
%{_unitdir}/virtnwfilterd.service
119c2d
%{_unitdir}/virtnwfilterd.socket
119c2d
%{_unitdir}/virtnwfilterd-ro.socket
119c2d
%{_unitdir}/virtnwfilterd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtnwfilterd
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
119c2d
%ghost %dir %{_rundir}/libvirt/network/
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
119c2d
%{_mandir}/man8/virtnwfilterd.8*
119c2d
119c2d
%files daemon-driver-secret
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtsecretd.conf
119c2d
%{_datadir}/augeas/lenses/virtsecretd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtsecretd.aug
119c2d
%{_unitdir}/virtsecretd.service
119c2d
%{_unitdir}/virtsecretd.socket
119c2d
%{_unitdir}/virtsecretd-ro.socket
119c2d
%{_unitdir}/virtsecretd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtsecretd
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so
119c2d
%{_mandir}/man8/virtsecretd.8*
119c2d
119c2d
%files daemon-driver-storage
119c2d
119c2d
%files daemon-driver-storage-core
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtstoraged.conf
119c2d
%{_datadir}/augeas/lenses/virtstoraged.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtstoraged.aug
119c2d
%{_unitdir}/virtstoraged.service
119c2d
%{_unitdir}/virtstoraged.socket
119c2d
%{_unitdir}/virtstoraged-ro.socket
119c2d
%{_unitdir}/virtstoraged-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtstoraged
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_fs.so
119c2d
%{_libdir}/%{name}/storage-file/libvirt_storage_file_fs.so
119c2d
%{_mandir}/man8/virtstoraged.8*
119c2d
119c2d
%files daemon-driver-storage-disk
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_disk.so
119c2d
119c2d
%files daemon-driver-storage-logical
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_logical.so
119c2d
119c2d
%files daemon-driver-storage-scsi
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_scsi.so
119c2d
119c2d
%files daemon-driver-storage-iscsi
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
119c2d
119c2d
%if %{with_storage_iscsi_direct}
119c2d
%files daemon-driver-storage-iscsi-direct
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi-direct.so
119c2d
%endif
119c2d
119c2d
%files daemon-driver-storage-mpath
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so
119c2d
119c2d
%if %{with_storage_gluster}
119c2d
%files daemon-driver-storage-gluster
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_gluster.so
119c2d
%{_libdir}/%{name}/storage-file/libvirt_storage_file_gluster.so
119c2d
%endif
119c2d
119c2d
%if %{with_storage_rbd}
119c2d
%files daemon-driver-storage-rbd
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_rbd.so
119c2d
%endif
119c2d
119c2d
%if %{with_storage_sheepdog}
119c2d
%files daemon-driver-storage-sheepdog
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so
119c2d
%endif
119c2d
119c2d
%if %{with_storage_zfs}
119c2d
%files daemon-driver-storage-zfs
119c2d
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
119c2d
%endif
119c2d
119c2d
%if %{with_qemu}
119c2d
%files daemon-driver-qemu
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
119c2d
%config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf
119c2d
%{_datadir}/augeas/lenses/virtqemud.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtqemud.aug
119c2d
%{_unitdir}/virtqemud.service
119c2d
%{_unitdir}/virtqemud.socket
119c2d
%{_unitdir}/virtqemud-ro.socket
119c2d
%{_unitdir}/virtqemud-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtqemud
119c2d
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
119c2d
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
119c2d
%ghost %dir %{_rundir}/libvirt/qemu/
119c2d
%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
119c2d
%dir %attr(0750, root, root) %{_localstatedir}/cache/libvirt/qemu/
119c2d
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so
119c2d
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/swtpm/
119c2d
%dir %attr(0730, tss, tss) %{_localstatedir}/log/swtpm/libvirt/qemu/
119c2d
%{_bindir}/virt-qemu-run
119c2d
%{_mandir}/man1/virt-qemu-run.1*
119c2d
%{_mandir}/man8/virtqemud.8*
119c2d
%endif
119c2d
119c2d
%if %{with_lxc}
119c2d
%files daemon-driver-lxc
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtlxcd.conf
119c2d
%{_datadir}/augeas/lenses/virtlxcd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtlxcd.aug
119c2d
%{_unitdir}/virtlxcd.service
119c2d
%{_unitdir}/virtlxcd.socket
119c2d
%{_unitdir}/virtlxcd-ro.socket
119c2d
%{_unitdir}/virtlxcd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtlxcd
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
119c2d
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
119c2d
%ghost %dir %{_rundir}/libvirt/lxc/
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
119c2d
%{_datadir}/augeas/lenses/libvirtd_lxc.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt_lxc
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so
119c2d
%{_mandir}/man8/virtlxcd.8*
119c2d
%endif
119c2d
119c2d
%if %{with_libxl}
119c2d
%files daemon-driver-libxl
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtxend.conf
119c2d
%{_datadir}/augeas/lenses/virtxend.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtxend.aug
119c2d
%{_unitdir}/virtxend.service
119c2d
%{_unitdir}/virtxend.socket
119c2d
%{_unitdir}/virtxend-ro.socket
119c2d
%{_unitdir}/virtxend-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtxend
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
119c2d
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
119c2d
%{_datadir}/augeas/lenses/libvirtd_libxl.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
119c2d
%ghost %dir %{_rundir}/libvirt/libxl/
119c2d
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
119c2d
%{_mandir}/man8/virtxend.8*
119c2d
%endif
119c2d
119c2d
%if %{with_vbox}
119c2d
%files daemon-driver-vbox
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virtvboxd.conf
119c2d
%{_datadir}/augeas/lenses/virtvboxd.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_virtvboxd.aug
119c2d
%{_unitdir}/virtvboxd.service
119c2d
%{_unitdir}/virtvboxd.socket
119c2d
%{_unitdir}/virtvboxd-ro.socket
119c2d
%{_unitdir}/virtvboxd-admin.socket
119c2d
%attr(0755, root, root) %{_sbindir}/virtvboxd
119c2d
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
119c2d
%{_mandir}/man8/virtvboxd.8*
119c2d
%endif
119c2d
119c2d
%if %{with_qemu_tcg}
119c2d
%files daemon-qemu
119c2d
%endif
119c2d
119c2d
%if %{with_qemu_kvm}
119c2d
%files daemon-kvm
119c2d
%endif
119c2d
119c2d
%if %{with_lxc}
119c2d
%files daemon-lxc
119c2d
%endif
119c2d
119c2d
%if %{with_libxl}
119c2d
%files daemon-xen
119c2d
%endif
119c2d
119c2d
%if %{with_vbox}
119c2d
%files daemon-vbox
119c2d
%endif
119c2d
119c2d
%if %{with_sanlock}
119c2d
%files lock-sanlock
119c2d
    %if %{with_qemu}
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
119c2d
    %endif
119c2d
    %if %{with_libxl}
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
119c2d
    %endif
119c2d
%attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
119c2d
%{_datadir}/augeas/lenses/libvirt_sanlock.aug
119c2d
%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
119c2d
%dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
119c2d
%{_sbindir}/virt-sanlock-cleanup
119c2d
%{_mandir}/man8/virt-sanlock-cleanup.8*
119c2d
%attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
119c2d
%endif
119c2d
119c2d
%files client
119c2d
%{_mandir}/man1/virsh.1*
119c2d
%{_mandir}/man1/virt-xml-validate.1*
119c2d
%{_mandir}/man1/virt-pki-query-dn.1*
119c2d
%{_mandir}/man1/virt-pki-validate.1*
119c2d
%{_bindir}/virsh
119c2d
%{_bindir}/virt-xml-validate
119c2d
%{_bindir}/virt-pki-query-dn
119c2d
%{_bindir}/virt-pki-validate
119c2d
119c2d
%{_datadir}/bash-completion/completions/virsh
119c2d
119c2d
%files libs -f %{name}.lang
119c2d
%license COPYING COPYING.LESSER
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
119c2d
%{_libdir}/libvirt.so.*
119c2d
%{_libdir}/libvirt-qemu.so.*
119c2d
%{_libdir}/libvirt-lxc.so.*
119c2d
%{_libdir}/libvirt-admin.so.*
119c2d
%dir %{_datadir}/libvirt/
119c2d
%dir %{_datadir}/libvirt/schemas/
119c2d
%dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
119c2d
119c2d
%{_datadir}/systemtap/tapset/libvirt_probes*.stp
119c2d
%{_datadir}/systemtap/tapset/libvirt_functions.stp
119c2d
%if %{with_qemu}
119c2d
%{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
119c2d
%endif
119c2d
119c2d
%{_datadir}/libvirt/schemas/*.rng
119c2d
119c2d
%{_datadir}/libvirt/cpu_map/*.xml
119c2d
119c2d
%{_datadir}/libvirt/test-screenshot.png
119c2d
119c2d
%if %{with_wireshark}
119c2d
%files wireshark
119c2d
%{wireshark_plugindir}/libvirt.so
119c2d
%endif
119c2d
119c2d
%files nss
119c2d
%{_libdir}/libnss_libvirt.so.2
119c2d
%{_libdir}/libnss_libvirt_guest.so.2
119c2d
119c2d
%if %{with_lxc}
119c2d
%files login-shell
119c2d
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
119c2d
%{_libexecdir}/virt-login-shell-helper
119c2d
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
119c2d
%{_mandir}/man1/virt-login-shell.1*
119c2d
%endif
119c2d
119c2d
%files devel
119c2d
%{_libdir}/libvirt.so
119c2d
%{_libdir}/libvirt-admin.so
119c2d
%{_libdir}/libvirt-qemu.so
119c2d
%{_libdir}/libvirt-lxc.so
119c2d
%dir %{_includedir}/libvirt
119c2d
%{_includedir}/libvirt/virterror.h
119c2d
%{_includedir}/libvirt/libvirt.h
119c2d
%{_includedir}/libvirt/libvirt-admin.h
119c2d
%{_includedir}/libvirt/libvirt-common.h
119c2d
%{_includedir}/libvirt/libvirt-domain.h
119c2d
%{_includedir}/libvirt/libvirt-domain-checkpoint.h
119c2d
%{_includedir}/libvirt/libvirt-domain-snapshot.h
119c2d
%{_includedir}/libvirt/libvirt-event.h
119c2d
%{_includedir}/libvirt/libvirt-host.h
119c2d
%{_includedir}/libvirt/libvirt-interface.h
119c2d
%{_includedir}/libvirt/libvirt-network.h
119c2d
%{_includedir}/libvirt/libvirt-nodedev.h
119c2d
%{_includedir}/libvirt/libvirt-nwfilter.h
119c2d
%{_includedir}/libvirt/libvirt-secret.h
119c2d
%{_includedir}/libvirt/libvirt-storage.h
119c2d
%{_includedir}/libvirt/libvirt-stream.h
119c2d
%{_includedir}/libvirt/libvirt-qemu.h
119c2d
%{_includedir}/libvirt/libvirt-lxc.h
119c2d
%{_libdir}/pkgconfig/libvirt.pc
119c2d
%{_libdir}/pkgconfig/libvirt-admin.pc
119c2d
%{_libdir}/pkgconfig/libvirt-qemu.pc
119c2d
%{_libdir}/pkgconfig/libvirt-lxc.pc
119c2d
119c2d
%dir %{_datadir}/libvirt/api/
119c2d
%{_datadir}/libvirt/api/libvirt-api.xml
119c2d
%{_datadir}/libvirt/api/libvirt-admin-api.xml
119c2d
%{_datadir}/libvirt/api/libvirt-qemu-api.xml
119c2d
%{_datadir}/libvirt/api/libvirt-lxc-api.xml
119c2d
119c2d
119c2d
%changelog
119c2d
* Thu Mar 31 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-8
119c2d
- qemu: fix hotplug for multiqueue vdpa net device (rhbz#2024406)
119c2d
119c2d
* Fri Mar 18 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-7
119c2d
- nwfilter: hold filter update lock when creating/deleting bindings (rhbz#2044379)
119c2d
- qemu,lxc: remove use to nwfilter update lock (rhbz#2044379)
119c2d
- qemu: support multiqueue for vdpa net device (rhbz#2024406)
119c2d
119c2d
* Thu Mar  3 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-6
119c2d
- qemu: support firmware descriptor flash 'mode' for optional NVRAM (rhbz#2057769)
119c2d
119c2d
* Thu Feb 24 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-5
119c2d
- Make systemd unit ordering more robust (rhbz#1868537)
119c2d
- util: Fix machined servicename (rhbz#1868537)
119c2d
119c2d
* Thu Feb 10 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-4
119c2d
- qemu_command: Generate memory only after controllers (rhbz#2047271)
119c2d
- qemu: Validate domain definition even on migration (rhbz#2048435)
119c2d
119c2d
* Wed Feb  2 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-3
119c2d
- qemuDomainSetupDisk: Initialize 'targetPaths' (rhbz#2046170)
119c2d
119c2d
* Tue Jan 25 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-2
119c2d
- build: Only install libvirt-guests when building libvirtd (rhbz#2042529)
119c2d
- docs: Add man page for libvirt-guests (rhbz#2042529)
119c2d
- remove sysconfig files (rhbz#2042529)
119c2d
- spec: Run pre/post-install stuff on 'daemon-driver-storage-core' (rhbz#2025644)
119c2d
- qemu: fix inactive snapshot revert (rhbz#2039136)
119c2d
- Revert "report error when virProcessGetStatInfo() is unable to parse data" (rhbz#2043579)
119c2d
119c2d
* Fri Jan 14 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-1
119c2d
- Rebased to libvirt-8.0.0 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#2039246, rhbz#2039652, rhbz#2039651, rhbz#2039131
119c2d
119c2d
* Mon Jan 10 2022 Jiri Denemark <jdenemar@redhat.com> - 8.0.0-0rc1.1
119c2d
- Rebased to libvirt-8.0.0-rc1 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#2034539, rhbz#2027400, rhbz#1945420, rhbz#1851249, rhbz#2032410
119c2d
    rhbz#2026812, rhbz#2032365, rhbz#2035888, rhbz#2036895, rhbz#2026537
119c2d
119c2d
* Wed Dec  1 2021 Jiri Denemark <jdenemar@redhat.com> - 7.10.0-1
119c2d
- Rebased to libvirt-7.10.0 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#2024098, rhbz#1964223, rhbz#2018488, rhbz#2021437, rhbz#2022589
119c2d
    rhbz#2023605, rhbz#1431589, rhbz#2024435, rhbz#2016599, rhbz#1945501
119c2d
    rhbz#2023674
119c2d
119c2d
* Fri Nov  5 2021 Jiri Denemark <jdenemar@redhat.com> - 7.9.0-1
119c2d
- Rebased to libvirt-7.9.0 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#2007659, rhbz#2014487, rhbz#1806856, rhbz#2014139, rhbz#1964223
119c2d
    rhbz#2007168, rhbz#2012386, rhbz#2013573, rhbz#1897708
119c2d
119c2d
* Tue Oct  5 2021 Jiri Denemark <jdenemar@redhat.com> - 7.8.0-1
119c2d
- Rebased to libvirt-7.8.0 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#1999420, rhbz#2002761, rhbz#1998920, rhbz#1986066, rhbz#1822891
119c2d
    rhbz#2001627, rhbz#1819160, rhbz#2000861, rhbz#2003092
119c2d
119c2d
* Wed Sep 22 2021 Jiri Denemark <jdenemar@redhat.com> - 7.7.0-3
119c2d
- virshDomainGetVcpuBitmap: Return bitmap when taking the fallback path (rhbz#2004429)
119c2d
119c2d
* Tue Sep 21 2021 Jiri Denemark <jdenemar@redhat.com> - 7.7.0-2
119c2d
- Update gating.yaml by adding subject_type
119c2d
- Revert "RHEL: spec: Do not enable modular daemons yet" (rhbz#1920012)
119c2d
119c2d
* Fri Sep 10 2021 Jiri Denemark <jdenemar@redhat.com> - 7.7.0-1
119c2d
- Rebased to libvirt-7.7.0 (rhbz#2001507)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#2001326, rhbz#2001391, rhbz#2001322, rhbz#2001389, rhbz#1967187
119c2d
    rhbz#2001327, rhbz#1977155, rhbz#2001997, rhbz#2001323
119c2d
- RHEL: spec: Do not enable modular daemons yet (rhbz#2001507)
119c2d
119c2d
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 7.6.0-2
119c2d
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
119c2d
  Related: rhbz#1991688
119c2d
119c2d
* Wed Aug  4 2021 Jiri Denemark <jdenemar@redhat.com> - 7.6.0-1
119c2d
- Rebased to libvirt-7.6.0 (rhbz#1950948)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#1986509, rhbz#1984318, rhbz#1810661, rhbz#1977776, rhbz#1948433
119c2d
    rhbz#1978526, rhbz#1976690
119c2d
119c2d
* Wed Jul 14 2021 Jiri Denemark <jdenemar@redhat.com> - 7.5.0-1
119c2d
- Rebased to libvirt-7.5.0 (rhbz#1950948)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#1949388, rhbz#1969354, rhbz#1970277, rhbz#1972145, rhbz#1973094
119c2d
    rhbz#1975071, rhbz#1972468, rhbz#1975677
119c2d
119c2d
* Mon Jun  7 2021 Jiri Denemark <jdenemar@redhat.com> - 7.4.0-1
119c2d
- Rebased to libvirt-7.4.0 (rhbz#1950948)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#1960993
119c2d
119c2d
* Mon May 24 2021 Jiri Denemark <jdenemar@redhat.com> - 7.3.0-1
119c2d
- Rebased to libvirt-7.3.0 (rhbz#1950948)
119c2d
- The rebase also fixes the following bugs:
119c2d
    rhbz#1898526, rhbz#1910617, rhbz#1910618, rhbz#1943392, rhbz#1946918
119c2d
    rhbz#1947718, rhbz#1947720, rhbz#1947824, rhbz#1949342, rhbz#1950228
119c2d
    rhbz#1950301, rhbz#1950601, rhbz#1950948, rhbz#1953939, rhbz#1958302
119c2d
    rhbz#1962053
119c2d
- RHEL: Enable usage of x-blockdev-reopen (rhbz#1953939)
119c2d
- RHEL: Add gating.yaml for RHEL9 (rhbz#1950601)
119c2d
119c2d
* Thu Apr 22 2021 Jiri Denemark <jdenemar@redhat.com> - 7.0.0-6
119c2d
- spec: Do not build qemu driver for Power on RHEL-9 (rhbz#1946529)
119c2d
119c2d
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 7.0.0-5
119c2d
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
119c2d
119c2d
* Wed Feb 03 2021 Cole Robinson <aintdiscole@gmail.com> - 7.0.0-4
119c2d
- Increase meson test timeout to fix builds on s390x copr
119c2d
119c2d
* Tue Feb 02 2021 Laine Stump <laine@redhat.com> - 7.0.0-3
119c2d
- disable netcf in build
119c2d
119c2d
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 7.0.0-2
119c2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
119c2d
119c2d
* Fri Jan 15 2021 Daniel P. Berrangé <berrange@redhat.com> - 7.0.0-1
119c2d
- Rebase to 7.0.0 release
119c2d
119c2d
* Fri Dec 04 2020 Cole Robinson <aintdiscole@gmail.com> - 6.10.0-2.1
119c2d
- Rebuild for wireshark soname bump
119c2d
119c2d
* Fri Dec 04 2020 Richard W.M. Jones <rjones@redhat.com> - 6.10.0-2
119c2d
- Build libvirt-daemon-kvm for riscv64.
119c2d
119c2d
* Tue Dec 01 2020 Cole Robinson <crobinso@redhat.com> - 6.10.0-1
119c2d
- Update to version 6.10.0
119c2d
119c2d
* Wed Nov  4 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.9.0-2
119c2d
- Re-apply reverted fix for disabling glusterfs, curl, openswman and libiscsi
119c2d
119c2d
* Tue Nov 03 2020 Cole Robinson <crobinso@redhat.com> - 6.9.0-1
119c2d
- Update to version 6.9.0
119c2d
119c2d
* Mon Nov  2 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.8.0-4
119c2d
- Really fix meson option for disabling glusterfs
119c2d
- Fix disabling curl, openswman and libiscsi
119c2d
119c2d
* Mon Nov  2 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.8.0-4
119c2d
- Fix name of meson option for disabling glusterfs
119c2d
119c2d
* Fri Oct 30 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.8.0-3
119c2d
- Fix stat() mocking for new glibc
119c2d
119c2d
* Wed Oct 28 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.8.0-2
119c2d
- Remove obsolete bash_completion conditional
119c2d
- Pass args to meson based on with_libssh/with_libssh2
119c2d
119c2d
* Thu Oct 01 2020 Cole Robinson <crobinso@redhat.com> - 6.8.0-1
119c2d
- Update to version 6.8.0
119c2d
119c2d
* Fri Sep  4 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.7.0-2
119c2d
- Fix QEMU start when KVM is not loaded (rhbz#1875327)
119c2d
119c2d
* Tue Sep 01 2020 Cole Robinson <crobinso@redhat.com> - 6.7.0-1
119c2d
- Update to version 6.7.0
119c2d
119c2d
* Fri Aug 21 2020 Merlin Mathesius <mmathesi@redhat.com> - 6.6.0-3
119c2d
- Fix so no platforms depend upon ceph for 32-bit architectures
119c2d
- Include upstream patches to fix GCC 10 warnings
119c2d
119c2d
* Fri Aug 21 2020 Daniel P. Berrangé <berrange@redhat.com> - 6.6.0-2
119c2d
- Fix creation of pools on non-btrfs (rhbz#1870197)
119c2d
119c2d
* Tue Aug 04 2020 Cole Robinson <crobinso@redhat.com> - 6.6.0-1
119c2d
- Update to version 6.6.0
119c2d
119c2d
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.5.0-2
119c2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
119c2d
119c2d
* Fri Jul 03 2020 Cole Robinson <crobinso@redhat.com> - 6.5.0-1
119c2d
- Update to version 6.5.0
119c2d
119c2d
* Tue Jun 02 2020 Cole Robinson <crobinso@redhat.com> - 6.4.0-1
119c2d
- Update to version 6.4.0
119c2d
119c2d
* Tue May 05 2020 Cole Robinson <crobinso@redhat.com> - 6.3.0-1
119c2d
- Update to version 6.3.0
119c2d
119c2d
* Thu Apr 02 2020 Cole Robinson <crobinso@redhat.com> - 6.2.0-1
119c2d
- Update to version 6.2.0
119c2d
119c2d
* Tue Mar 24 2020 Felipe Borges <feborges@redhat.com> - 6.1.0-2
119c2d
- Check for disk type correctly in virDomainDiskTranslateSourcePool
119c2d
119c2d
* Wed Mar 04 2020 Cole Robinson <crobinso@redhat.com> - 6.1.0-1
119c2d
- Update to version 6.1.0
119c2d
119c2d
* Tue Feb 25 2020 Cole Robinson <crobinso@redhat.com> - 6.0.0-3
119c2d
- Rebuild for libiscsi soname bump
119c2d
119c2d
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-2
119c2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
119c2d
119c2d
* Wed Jan 15 2020 Cole Robinson <crobinso@redhat.com> - 6.0.0-1
119c2d
- Update to version 6.0.0