node_device_udev: add error reporting to udevProcessCCWGroup
[libvirt.git] / libvirt.spec.in
blobcb41ea1de1c6cd3d3d5f8c810d0df7be4f7d490f
1 # -*- rpm-spec -*-
3 # This spec file assumes you are building on a Fedora or RHEL version
4 # that's still supported by the vendor. It may work on other distros
5 # or versions, but no effort will be made to ensure that going forward.
6 %define min_rhel 8
7 %define min_fedora 37
9 %define arches_qemu_kvm %{ix86} x86_64 %{power64} %{arm} aarch64 s390x riscv64
10 %if 0%{?rhel}
11 %if 0%{?rhel} > 8
12 %define arches_qemu_kvm x86_64 aarch64 s390x
13 %else
14 %define arches_qemu_kvm x86_64 %{power64} aarch64 s390x
15 %endif
16 %endif
18 %define arches_64bit x86_64 %{power64} aarch64 s390x riscv64
19 %define arches_x86 %{ix86} x86_64
21 %define arches_systemtap_64bit %{arches_64bit}
22 %define arches_dmidecode %{arches_x86} aarch64 riscv64
23 %define arches_xen %{arches_x86} aarch64
24 %if 0%{?fedora}
25 %define arches_xen x86_64 aarch64
26 %endif
27 %define arches_vbox %{arches_x86}
28 %define arches_ceph %{arches_64bit}
29 %define arches_zfs %{arches_x86} %{power64} %{arm}
30 %define arches_numactl %{arches_x86} %{power64} aarch64 s390x
31 %define arches_numad %{arches_x86} %{power64} aarch64
32 %define arches_ch x86_64 aarch64
34 # The hypervisor drivers that run in libvirtd
35 %define with_qemu 0%{!?_without_qemu:1}
36 %define with_lxc 0%{!?_without_lxc:1}
37 %define with_libxl 0%{!?_without_libxl:1}
38 %define with_vbox 0%{!?_without_vbox:1}
39 %define with_ch 0%{!?_without_ch:1}
41 %ifarch %{arches_qemu_kvm}
42 %define with_qemu_kvm %{with_qemu}
43 %else
44 %define with_qemu_kvm 0
45 %endif
47 %if 0%{?fedora} >= 42
48 %define with_account_add 0
49 %else
50 %define with_account_add 1
51 %endif
53 %define with_qemu_tcg %{with_qemu}
55 # RHEL disables TCG on all architectures
56 %if 0%{?rhel}
57 %define with_qemu_tcg 0
58 %endif
60 %if ! %{with_qemu_tcg} && ! %{with_qemu_kvm}
61 %define with_qemu 0
62 %endif
64 # Then the hypervisor drivers that run outside libvirtd, in libvirt.so
65 %define with_openvz 0%{!?_without_openvz:1}
66 %define with_vmware 0%{!?_without_vmware:1}
67 %define with_esx 0%{!?_without_esx:1}
68 %define with_hyperv 0%{!?_without_hyperv:1}
70 # Then the secondary host drivers, which run inside libvirtd
71 %define with_storage_rbd 0%{!?_without_storage_rbd:1}
73 %define with_storage_gluster 0%{!?_without_storage_gluster:1}
74 %if 0%{?rhel}
75 # Glusterfs has been dropped in RHEL-9, and before that
76 # was only enabled on arches where KVM exists
77 %if 0%{?rhel} > 8
78 %define with_storage_gluster 0
79 %else
80 %ifnarch %{arches_qemu_kvm}
81 %define with_storage_gluster 0
82 %endif
83 %endif
84 %endif
86 # Fedora has zfs-fuse
87 %if 0%{?fedora}
88 %define with_storage_zfs 0%{!?_without_storage_zfs:1}
89 %else
90 %define with_storage_zfs 0
91 %endif
93 %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
94 # libiscsi has been dropped in RHEL-9
95 %if 0%{?rhel} > 8
96 %define with_storage_iscsi_direct 0
97 %endif
99 # Other optional features
100 %define with_numactl 0%{!?_without_numactl:1}
101 %define with_userfaultfd_sysctl 0%{!?_without_userfaultfd_sysctl:1}
103 # A few optional bits off by default, we enable later
104 %define with_fuse 0
105 %define with_sanlock 0
106 %define with_numad 0
107 %define with_nbdkit 0
108 %define with_nbdkit_config_default 0
109 %define with_firewalld_zone 0
110 %define with_netcf 0
111 %define with_libssh2 0
112 %define with_wireshark 0
113 %define with_libssh 0
114 %define with_dmidecode 0
116 # Finally set the OS / architecture specific special cases
118 # Architecture-dependent features
119 %ifnarch %{arches_xen}
120 %define with_libxl 0
121 %endif
122 %ifnarch %{arches_vbox}
123 %define with_vbox 0
124 %endif
125 %ifnarch %{arches_numactl}
126 %define with_numactl 0
127 %endif
128 %ifnarch %{arches_zfs}
129 %define with_storage_zfs 0
130 %endif
131 %ifnarch %{arches_ceph}
132 %define with_storage_rbd 0
133 %endif
134 %ifnarch %{arches_ch}
135 %define with_ch 0
136 %endif
138 # RHEL doesn't ship many hypervisor drivers
139 %if 0%{?rhel}
140 %define with_openvz 0
141 %define with_vbox 0
142 %define with_vmware 0
143 %define with_libxl 0
144 %define with_hyperv 0
145 %define with_lxc 0
146 %define with_ch 0
147 %endif
149 %define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
151 %if 0%{?rhel} && 0%{?rhel} < 9
152 %define with_netcf 0%{!?_without_netcf:1}
153 %endif
155 # fuse is used to provide virtualized /proc for LXC
156 %if %{with_lxc}
157 %define with_fuse 0%{!?_without_fuse:1}
158 %endif
160 # Enable sanlock library for lock management with QEMU
161 # Sanlock is available only on arches where kvm is available for RHEL
162 %if 0%{?fedora}
163 %define with_sanlock 0%{!?_without_sanlock:1}
164 %endif
165 %if 0%{?rhel}
166 %ifarch %{arches_qemu_kvm}
167 %define with_sanlock 0%{!?_without_sanlock:1}
168 %endif
169 %endif
171 # Enable libssh2 transport for new enough distros
172 %if 0%{?fedora}
173 %define with_libssh2 0%{!?_without_libssh2:1}
174 %endif
176 # Enable wireshark plugins for all distros
177 %define with_wireshark 0%{!?_without_wireshark:1}
178 %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
180 # Enable libssh transport for all distros
181 %define with_libssh 0%{!?_without_libssh:1}
183 %if %{with_qemu} || %{with_lxc}
184 # numad is used to manage the CPU and memory placement dynamically,
185 # it's not available on many non-x86 architectures.
186 %ifarch %{arches_numad}
187 %define with_numad 0%{!?_without_numad:1}
188 %endif
189 %endif
191 # We want to build with nbdkit support, but should only enable nbdkit by
192 # default if the OS ships a SELinux policy that allows libvirt to launch it.
193 # Right now that's not the case anywhere, but things should be fine by the time
194 # Fedora 40 is released.
195 %if %{with_qemu}
196 # rhel-8 lacks pidfd_open
197 %if 0%{?fedora} || 0%{?rhel} >= 9
198 %define with_nbdkit 0%{!?_without_nbdkit:1}
200 # setting 'with_nbdkit_config_default' must be done only when compiling
201 # in nbdkit support
203 # TODO: add RHEL 9 once a minor release that contains the necessary SELinux
204 # bits exists (we only support the most recent minor release)
205 %if 0%{?fedora} >= 40
206 %define with_nbdkit_config_default 0%{!?_without_nbdkit_config_default:1}
207 %endif
208 %endif
209 %endif
211 %ifarch %{arches_dmidecode}
212 %define with_dmidecode 0%{!?_without_dmidecode:1}
213 %endif
215 %define with_modular_daemons 0
216 %if 0%{?fedora} || 0%{?rhel} >= 9
217 %define with_modular_daemons 1
218 %endif
220 # Prefer nftables for future OS releases but keep using iptables
221 # for existing ones
222 %if 0%{?rhel} >= 10 || 0%{?fedora} >= 41
223 %define prefer_nftables 1
224 %define firewall_backend_priority nftables,iptables
225 %else
226 %define prefer_nftables 0
227 %define firewall_backend_priority iptables,nftables
228 %endif
232 # Force QEMU to run as non-root
233 %define qemu_user qemu
234 %define qemu_group qemu
236 # Locations for QEMU data
237 %define qemu_moddir %{_libdir}/qemu
238 %define qemu_datadir %{_datadir}/qemu
240 # Native / MinGW builds
241 %define with_native 0%{!?_without_native:1}
243 %define with_mingw32 0
244 %define with_mingw64 0
246 %if 0%{?fedora}
247 %if 0%{!?_without_mingw:1}
248 %define with_mingw32 0%{!?_without_mingw32:1}
249 %define with_mingw64 0%{!?_without_mingw64:1}
250 %endif
252 # These tell the other mingw macros whether to perform or
253 # skip the 32-bit and 64-bit specific steps respectively
254 %define mingw_build_win32 %{with_mingw32}
255 %define mingw_build_win64 %{with_mingw64}
256 %endif
258 %if !%{with_native}
259 # Building the debugsource package apparently only works if the
260 # native build is enabled. debuginfo packages don't have this
261 # problem and setting this doesn't disable them
262 %global debug_package %{nil}
263 %endif
265 # RHEL releases provide stable tool chains and so it is safe to turn
266 # compiler warning into errors without being worried about frequent
267 # changes in reported warnings
268 %if 0%{?rhel}
269 %define enable_werror -Dwerror=true
270 %else
271 %define enable_werror -Dwerror=false -Dgit_werror=disabled
272 %endif
274 # Fedora and RHEL-9 are new enough to support /dev/userfaultfd, which
275 # does not require enabling vm.unprivileged_userfaultfd sysctl.
276 %if 0%{?fedora} || 0%{?rhel} >= 9
277 %define with_userfaultfd_sysctl 0
278 %endif
280 %define tls_priority "@LIBVIRT,SYSTEM"
282 # libvirt 8.1.0 stops distributing any sysconfig files.
283 # If the user has customized their sysconfig file,
284 # the RPM upgrade path will rename it to .rpmsave
285 # because the file is no longer managed by RPM.
286 # To prevent a regression we rename it back after the
287 # transaction to preserve the user's modifications
288 %define libvirt_sysconfig_pre() \
289 for sc in %{?*} ; do \
290 test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ; \
291 mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" "%{_sysconfdir}/sysconfig/${sc}.rpmsave.old" ; \
292 done \
293 %{nil}
294 %define libvirt_sysconfig_posttrans() \
295 for sc in %{?*} ; do \
296 test -f "%{_sysconfdir}/sysconfig/${sc}.rpmsave" || continue ; \
297 mv -v "%{_sysconfdir}/sysconfig/${sc}.rpmsave" "%{_sysconfdir}/sysconfig/${sc}" ; \
298 done \
299 %{nil}
301 Summary: Library providing a simple virtualization API
302 Name: libvirt
303 Version: @VERSION@
304 Release: 1%{?dist}
305 License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
306 URL: https://libvirt.org/
308 %if %(echo %{version} | grep "\.0$" >/dev/null; echo $?) == 1
309 %define mainturl stable_updates/
310 %endif
311 Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
313 Requires: libvirt-daemon = %{version}-%{release}
314 Requires: libvirt-daemon-config-network = %{version}-%{release}
315 Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
316 %if %{with_libxl}
317 Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
318 %endif
319 %if %{with_lxc}
320 Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
321 %endif
322 %if %{with_qemu}
323 Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
324 Requires: libvirt-client-qemu = %{version}-%{release}
325 %endif
326 # We had UML driver, but we've removed it.
327 Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
328 Obsoletes: libvirt-daemon-uml <= 5.0.0
329 %if %{with_vbox}
330 Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
331 %endif
332 %if %{with_ch}
333 Requires: libvirt-daemon-driver-ch = %{version}-%{release}
334 %endif
335 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
336 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
337 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
338 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
339 Requires: libvirt-daemon-driver-network = %{version}-%{release}
340 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
341 Requires: libvirt-client = %{version}-%{release}
342 Requires: libvirt-libs = %{version}-%{release}
344 # All build-time requirements. Run-time requirements are
345 # listed against each sub-RPM
346 BuildRequires: python3-docutils
347 BuildRequires: meson >= 0.56.0
348 BuildRequires: ninja-build
349 BuildRequires: git-core
350 BuildRequires: perl-interpreter
351 BuildRequires: python3
352 BuildRequires: python3-pytest
353 # For xmllint
354 BuildRequires: libxml2
355 # For xsltproc
356 BuildRequires: libxslt
357 BuildRequires: gettext
358 BuildRequires: systemd-rpm-macros
359 # Fedora build root suckage
360 BuildRequires: gawk
361 %if %{with_native}
362 BuildRequires: gcc
363 %if %{with_libxl}
364 BuildRequires: xen-devel
365 %endif
366 BuildRequires: glib2-devel >= 2.66
367 BuildRequires: libxml2-devel
368 BuildRequires: readline-devel
369 BuildRequires: pkgconfig(bash-completion) >= 2.0
370 BuildRequires: libtasn1-devel
371 BuildRequires: gnutls-devel
372 BuildRequires: libattr-devel
373 # For pool-build probing for existing pools
374 BuildRequires: libblkid-devel >= 2.17
375 # for augparse, optionally used in testing
376 BuildRequires: augeas
377 BuildRequires: systemd-devel >= 185
378 BuildRequires: libpciaccess-devel >= 0.10.9
379 BuildRequires: json-c-devel
380 %if %{with_sanlock}
381 BuildRequires: sanlock-devel >= 2.4
382 %endif
383 BuildRequires: libpcap-devel >= 1.5.0
384 BuildRequires: libnl3-devel
385 BuildRequires: libselinux-devel
386 # For modprobe
387 BuildRequires: kmod
388 BuildRequires: cyrus-sasl-devel
389 BuildRequires: polkit >= 0.112
390 # For mount/umount in FS driver
391 BuildRequires: util-linux
392 %if %{with_qemu}
393 # For managing ACLs
394 BuildRequires: libacl-devel
395 # From QEMU RPMs, used by virstoragetest
396 BuildRequires: /usr/bin/qemu-img
397 %endif
398 # nbdkit support requires libnbd
399 %if %{with_nbdkit}
400 BuildRequires: libnbd-devel
401 %endif
402 # For LVM drivers
403 BuildRequires: lvm2
404 # For pool type=iscsi
405 BuildRequires: iscsi-initiator-utils
406 %if %{with_storage_iscsi_direct}
407 # For pool type=iscsi-direct
408 BuildRequires: libiscsi-devel
409 %endif
410 # For disk driver
411 BuildRequires: parted-devel
412 # For Multipath support
413 BuildRequires: device-mapper-devel
414 %if %{with_storage_rbd}
415 BuildRequires: librados-devel
416 BuildRequires: librbd-devel
417 %endif
418 %if %{with_storage_gluster}
419 BuildRequires: glusterfs-api-devel >= 3.4.1
420 BuildRequires: glusterfs-devel >= 3.4.1
421 %endif
422 %if %{with_numactl}
423 # For QEMU/LXC numa info
424 BuildRequires: numactl-devel
425 %endif
426 BuildRequires: libcap-ng-devel >= 0.5.0
427 %if %{with_fuse}
428 BuildRequires: fuse-devel >= 2.8.6
429 %endif
430 %if %{with_libssh2}
431 BuildRequires: libssh2-devel >= 1.3.0
432 %endif
433 %if %{with_netcf}
434 BuildRequires: netcf-devel >= 0.2.2
435 %endif
436 %if %{with_esx}
437 BuildRequires: libcurl-devel
438 %endif
439 %if %{with_hyperv}
440 BuildRequires: libwsman-devel >= 2.6.3
441 %endif
442 BuildRequires: audit-libs-devel
443 BuildRequires: systemtap-sdt-devel
444 BuildRequires: /usr/bin/dtrace
445 # For mount/umount in FS driver
446 BuildRequires: util-linux
447 %if %{with_numad}
448 BuildRequires: numad
449 %endif
450 %if %{with_wireshark}
451 BuildRequires: wireshark-devel
452 %endif
453 %if %{with_libssh}
454 BuildRequires: libssh-devel >= 0.8.1
455 %endif
456 BuildRequires: libtirpc-devel
457 %if %{with_firewalld_zone}
458 # Needed for the firewalld_reload macro
459 BuildRequires: firewalld-filesystem
460 %endif
461 %endif
463 %if %{with_mingw32}
464 BuildRequires: mingw32-filesystem
465 BuildRequires: mingw32-gcc
466 BuildRequires: mingw32-binutils
467 BuildRequires: mingw32-glib2 >= 2.48
468 BuildRequires: mingw32-gnutls
469 BuildRequires: mingw32-gettext
470 BuildRequires: mingw32-libxml2
471 BuildRequires: mingw32-portablexdr
472 BuildRequires: mingw32-dlfcn
473 BuildRequires: mingw32-libssh2
474 BuildRequires: mingw32-curl
475 %endif
476 %if %{with_mingw64}
477 BuildRequires: mingw64-filesystem
478 BuildRequires: mingw64-gcc
479 BuildRequires: mingw64-binutils
480 BuildRequires: mingw64-glib2 >= 2.48
481 BuildRequires: mingw64-gnutls
482 BuildRequires: mingw64-gettext
483 BuildRequires: mingw64-libxml2
484 BuildRequires: mingw64-portablexdr
485 BuildRequires: mingw64-dlfcn
486 BuildRequires: mingw64-libssh2
487 BuildRequires: mingw64-curl
488 %endif
490 %description
491 Libvirt is a C toolkit to interact with the virtualization capabilities
492 of recent versions of Linux (and other OSes). The main package includes
493 the libvirtd server exporting the virtualization support.
495 %if %{with_native}
496 %package docs
497 Summary: API reference and website documentation
499 %description docs
500 Includes the API reference for the libvirt C library, and a complete
501 copy of the libvirt.org website documentation.
503 %package daemon
504 Summary: Server side daemon and supporting files for libvirt library
506 # All runtime requirements for the libvirt package (runtime requrements
507 # for subpackages are listed later in those subpackages)
509 # The client side, i.e. shared libs are in a subpackage
510 Requires: libvirt-libs = %{version}-%{release}
511 Requires: libvirt-daemon-common = %{version}-%{release}
512 Requires: libvirt-daemon-lock = %{version}-%{release}
513 Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
514 Requires: libvirt-daemon-log = %{version}-%{release}
515 Requires: libvirt-daemon-proxy = %{version}-%{release}
517 %description daemon
518 Server side daemon required to manage the virtualization capabilities
519 of recent versions of Linux. Requires a hypervisor specific sub-RPM
520 for specific drivers.
522 %package daemon-common
523 Summary: Files and utilities used by daemons
524 Requires: libvirt-libs = %{version}-%{release}
525 # The libvirt-guests.sh script requires virsh from libvirt-client subpackage,
526 # but not every deployment wants to use libvirt-guests service. Using
527 # Recommends here will install libvirt-client by default (if available), but
528 # RPM won't complain if the package is unavailable, masked, or removed later.
529 Recommends: libvirt-client = %{version}-%{release}
530 # for /sbin/ip
531 Requires: iproute
532 # for /sbin/tc
533 Requires: iproute-tc
534 Requires: polkit >= 0.112
535 %if %{with_dmidecode}
536 # For virConnectGetSysinfo
537 Requires: dmidecode
538 %endif
539 # For service management
540 Requires(posttrans): /usr/bin/systemctl
541 Requires(preun): /usr/bin/systemctl
542 # libvirtd depends on 'messagebus' service
543 Requires: dbus
544 %if %{with_account_add}
545 # For uid creation during pre
546 Requires(pre): shadow-utils
547 %endif
548 # Needed by /usr/libexec/libvirt-guests.sh script.
549 %if 0%{?fedora}
550 Requires: gettext-runtime
551 %else
552 Requires: gettext
553 %endif
555 # Ensure smooth upgrades
556 Obsoletes: libvirt-admin < 7.3.0
557 Provides: libvirt-admin = %{version}-%{release}
558 Obsoletes: libvirt-bash-completion < 7.3.0
560 %description daemon-common
561 Miscellaneous files and utilities used by other libvirt daemons
563 %package daemon-lock
564 Summary: Server side daemon for managing locks
565 Requires: libvirt-libs = %{version}-%{release}
567 %description daemon-lock
568 Server side daemon used to manage locks held against virtual machine
569 resources
571 %package daemon-plugin-lockd
572 Summary: lockd client plugin for virtlockd
573 Requires: libvirt-libs = %{version}-%{release}
574 Requires: libvirt-daemon-common = %{version}-%{release}
575 Requires: libvirt-daemon-lock = %{version}-%{release}
577 %description daemon-plugin-lockd
578 A client-side plugin that implements disk locking using POSIX fcntl advisory
579 locks via communication with the virtlockd daemon
581 %package daemon-log
582 Summary: Server side daemon for managing logs
583 Requires: libvirt-libs = %{version}-%{release}
585 %description daemon-log
586 Server side daemon used to manage logs from virtual machine consoles
588 %package daemon-proxy
589 Summary: Server side daemon providing libvirtd proxy
590 Requires: libvirt-libs = %{version}-%{release}
591 # netcat is needed on the server side so that clients that have
592 # libvirt < 6.9.0 can connect, but newer versions will prefer
593 # virt-ssh-helper. Making this a Recommends means that it gets
594 # installed by default, but can still be removed if compatibility
595 # with old clients is not required
596 Recommends: /usr/bin/nc
598 %description daemon-proxy
599 Server side daemon providing functionality previously provided by
600 the monolithic libvirtd
602 %package daemon-config-network
603 Summary: Default configuration files for the libvirtd daemon
605 Requires: libvirt-daemon-driver-network = %{version}-%{release}
607 %description daemon-config-network
608 Default configuration files for setting up NAT based networking
610 %package daemon-config-nwfilter
611 Summary: Network filter configuration files for the libvirtd daemon
613 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
615 %description daemon-config-nwfilter
616 Network filter configuration files for cleaning guest traffic
618 %package daemon-driver-network
619 Summary: Network driver plugin for the libvirtd daemon
620 Requires: libvirt-daemon-common = %{version}-%{release}
621 Requires: libvirt-libs = %{version}-%{release}
622 Requires: dnsmasq >= 2.41
623 %if %{prefer_nftables}
624 Requires: nftables
625 %else
626 Requires: iptables
627 %endif
629 %description daemon-driver-network
630 The network driver plugin for the libvirtd daemon, providing
631 an implementation of the virtual network APIs using the Linux
632 bridge capabilities.
634 %package daemon-driver-nwfilter
635 Summary: Nwfilter driver plugin for the libvirtd daemon
636 Requires: libvirt-daemon-common = %{version}-%{release}
637 Requires: libvirt-libs = %{version}-%{release}
638 Requires: iptables
639 Requires: ebtables
641 %description daemon-driver-nwfilter
642 The nwfilter driver plugin for the libvirtd daemon, providing
643 an implementation of the firewall APIs using the ebtables,
644 iptables and ip6tables capabilities
646 %package daemon-driver-nodedev
647 Summary: Nodedev driver plugin for the libvirtd daemon
648 Requires: libvirt-daemon-common = %{version}-%{release}
649 Requires: libvirt-libs = %{version}-%{release}
650 # needed for device enumeration
651 Requires: systemd >= 185
652 # For managing persistent mediated devices
653 # Note: for nodedev-update support at least mdevctl v1.3.0 is required
654 Requires: mdevctl
655 # for modprobe of pci devices
656 Requires: module-init-tools
658 %description daemon-driver-nodedev
659 The nodedev driver plugin for the libvirtd daemon, providing
660 an implementation of the node device APIs using the udev
661 capabilities.
663 %package daemon-driver-interface
664 Summary: Interface driver plugin for the libvirtd daemon
665 Requires: libvirt-daemon-common = %{version}-%{release}
666 Requires: libvirt-libs = %{version}-%{release}
667 %if %{with_netcf}
668 Requires: netcf-libs >= 0.2.2
669 %endif
671 %description daemon-driver-interface
672 The interface driver plugin for the libvirtd daemon, providing
673 an implementation of the host network interface APIs.
675 %package daemon-driver-secret
676 Summary: Secret driver plugin for the libvirtd daemon
677 Requires: libvirt-daemon-common = %{version}-%{release}
678 Requires: libvirt-libs = %{version}-%{release}
680 %description daemon-driver-secret
681 The secret driver plugin for the libvirtd daemon, providing
682 an implementation of the secret key APIs.
684 %package daemon-driver-storage-core
685 Summary: Storage driver plugin including base backends for the libvirtd daemon
686 Requires: libvirt-daemon-common = %{version}-%{release}
687 Requires: libvirt-libs = %{version}-%{release}
688 Recommends: nfs-utils
689 # For mkfs
690 Requires: util-linux
691 # For storage wiping with different algorithms
692 Requires: scrub
693 %if %{with_qemu}
694 # From QEMU RPMs
695 Requires: /usr/bin/qemu-img
696 %endif
697 %if !%{with_storage_rbd}
698 Obsoletes: libvirt-daemon-driver-storage-rbd < 5.2.0
699 %endif
700 Obsoletes: libvirt-daemon-driver-storage-sheepdog < 8.8.0
702 %description daemon-driver-storage-core
703 The storage driver plugin for the libvirtd daemon, providing
704 an implementation of the storage APIs using files, local disks, LVM, SCSI,
705 iSCSI, and multipath storage.
707 %package daemon-driver-storage-logical
708 Summary: Storage driver plugin for lvm volumes
709 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
710 Requires: libvirt-libs = %{version}-%{release}
711 Requires: lvm2
713 %description daemon-driver-storage-logical
714 The storage driver backend adding implementation of the storage APIs for block
715 volumes using lvm.
717 %package daemon-driver-storage-disk
718 Summary: Storage driver plugin for disk
719 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
720 Requires: libvirt-libs = %{version}-%{release}
721 Requires: parted
722 Requires: device-mapper
724 %description daemon-driver-storage-disk
725 The storage driver backend adding implementation of the storage APIs for block
726 volumes using the host disks.
728 %package daemon-driver-storage-scsi
729 Summary: Storage driver plugin for local scsi devices
730 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
731 Requires: libvirt-libs = %{version}-%{release}
733 %description daemon-driver-storage-scsi
734 The storage driver backend adding implementation of the storage APIs for scsi
735 host devices.
737 %package daemon-driver-storage-iscsi
738 Summary: Storage driver plugin for iscsi
739 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
740 Requires: libvirt-libs = %{version}-%{release}
741 Requires: iscsi-initiator-utils
743 %description daemon-driver-storage-iscsi
744 The storage driver backend adding implementation of the storage APIs for iscsi
745 volumes using the host iscsi stack.
747 %if %{with_storage_iscsi_direct}
748 %package daemon-driver-storage-iscsi-direct
749 Summary: Storage driver plugin for iscsi-direct
750 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
751 Requires: libvirt-libs = %{version}-%{release}
753 %description daemon-driver-storage-iscsi-direct
754 The storage driver backend adding implementation of the storage APIs for iscsi
755 volumes using libiscsi direct connection.
756 %endif
758 %package daemon-driver-storage-mpath
759 Summary: Storage driver plugin for multipath volumes
760 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
761 Requires: libvirt-libs = %{version}-%{release}
762 Requires: device-mapper
764 %description daemon-driver-storage-mpath
765 The storage driver backend adding implementation of the storage APIs for
766 multipath storage using device mapper.
768 %if %{with_storage_gluster}
769 %package daemon-driver-storage-gluster
770 Summary: Storage driver plugin for gluster
771 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
772 Requires: libvirt-libs = %{version}-%{release}
773 %if 0%{?fedora}
774 Requires: glusterfs-client >= 2.0.1
775 %endif
776 %if 0%{?fedora} || 0%{?with_storage_gluster}
777 Requires: /usr/sbin/gluster
778 %endif
780 %description daemon-driver-storage-gluster
781 The storage driver backend adding implementation of the storage APIs for gluster
782 volumes using libgfapi.
783 %endif
785 %if %{with_storage_rbd}
786 %package daemon-driver-storage-rbd
787 Summary: Storage driver plugin for rbd
788 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
789 Requires: libvirt-libs = %{version}-%{release}
791 %description daemon-driver-storage-rbd
792 The storage driver backend adding implementation of the storage APIs for rbd
793 volumes using the ceph protocol.
794 %endif
796 %if %{with_storage_zfs}
797 %package daemon-driver-storage-zfs
798 Summary: Storage driver plugin for ZFS
799 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
800 Requires: libvirt-libs = %{version}-%{release}
801 # Support any conforming implementation of zfs
802 Requires: /sbin/zfs
803 Requires: /sbin/zpool
805 %description daemon-driver-storage-zfs
806 The storage driver backend adding implementation of the storage APIs for
807 ZFS volumes.
808 %endif
810 %package daemon-driver-storage
811 Summary: Storage driver plugin including all backends for the libvirtd daemon
812 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
813 Requires: libvirt-daemon-driver-storage-disk = %{version}-%{release}
814 Requires: libvirt-daemon-driver-storage-logical = %{version}-%{release}
815 Requires: libvirt-daemon-driver-storage-scsi = %{version}-%{release}
816 Requires: libvirt-daemon-driver-storage-iscsi = %{version}-%{release}
817 Requires: libvirt-daemon-driver-storage-mpath = %{version}-%{release}
818 %if %{with_storage_iscsi_direct}
819 Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
820 %endif
821 %if %{with_storage_gluster}
822 Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
823 %endif
824 %if %{with_storage_rbd}
825 Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
826 %endif
827 %if %{with_storage_zfs}
828 Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
829 %endif
831 %description daemon-driver-storage
832 The storage driver plugin for the libvirtd daemon, providing
833 an implementation of the storage APIs using LVM, iSCSI,
834 parted and more.
836 %if %{with_qemu}
837 %package daemon-driver-qemu
838 Summary: QEMU driver plugin for the libvirtd daemon
839 Requires: libvirt-daemon-common = %{version}-%{release}
840 Requires: libvirt-daemon-log = %{version}-%{release}
841 Requires: libvirt-libs = %{version}-%{release}
842 Requires: /usr/bin/qemu-img
843 # For image compression
844 Requires: gzip
845 Requires: bzip2
846 Requires: lzop
847 Requires: xz
848 Requires: zstd
849 Requires: systemd-container
850 Requires: swtpm-tools
851 %if %{with_numad}
852 Requires: numad
853 %endif
854 %if 0%{?fedora} || 0%{?rhel} >= 9
855 Recommends: passt
856 Recommends: passt-selinux
857 %endif
858 %if %{with_nbdkit}
859 Recommends: nbdkit
860 Recommends: nbdkit-curl-plugin
861 Recommends: nbdkit-ssh-plugin
862 %endif
864 %description daemon-driver-qemu
865 The qemu driver plugin for the libvirtd daemon, providing
866 an implementation of the hypervisor driver APIs using
867 QEMU
868 %endif
870 %if %{with_lxc}
871 %package daemon-driver-lxc
872 Summary: LXC driver plugin for the libvirtd daemon
873 Requires: libvirt-daemon-common = %{version}-%{release}
874 Requires: libvirt-libs = %{version}-%{release}
875 # There really is a hard cross-driver dependency here
876 Requires: libvirt-daemon-driver-network = %{version}-%{release}
877 Requires: systemd-container
878 # for modprobe of nbd driver
879 Requires: module-init-tools
880 %if %{with_numad}
881 Requires: numad
882 %endif
884 %description daemon-driver-lxc
885 The LXC driver plugin for the libvirtd daemon, providing
886 an implementation of the hypervisor driver APIs using
887 the Linux kernel
888 %endif
890 %if %{with_vbox}
891 %package daemon-driver-vbox
892 Summary: VirtualBox driver plugin for the libvirtd daemon
893 Requires: libvirt-daemon-common = %{version}-%{release}
894 Requires: libvirt-libs = %{version}-%{release}
896 %description daemon-driver-vbox
897 The vbox driver plugin for the libvirtd daemon, providing
898 an implementation of the hypervisor driver APIs using
899 VirtualBox
900 %endif
902 %if %{with_libxl}
903 %package daemon-driver-libxl
904 Summary: Libxl driver plugin for the libvirtd daemon
905 Requires: libvirt-daemon-common = %{version}-%{release}
906 Requires: libvirt-libs = %{version}-%{release}
907 Obsoletes: libvirt-daemon-driver-xen < 4.3.0
909 %description daemon-driver-libxl
910 The Libxl driver plugin for the libvirtd daemon, providing
911 an implementation of the hypervisor driver APIs using
912 Libxl
913 %endif
915 %if %{with_qemu_tcg}
916 %package daemon-qemu
917 Summary: Server side daemon & driver required to run QEMU guests
919 %if %{with_modular_daemons}
920 Requires: libvirt-daemon-common = %{version}-%{release}
921 Requires: libvirt-daemon-log = %{version}-%{release}
922 Requires: libvirt-daemon-lock = %{version}-%{release}
923 Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
924 Requires: libvirt-daemon-proxy = %{version}-%{release}
925 Recommends: libvirt-daemon = %{version}-%{release}
926 %else
927 Requires: libvirt-daemon = %{version}-%{release}
928 %endif
929 Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
930 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
931 Requires: libvirt-daemon-driver-network = %{version}-%{release}
932 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
933 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
934 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
935 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
936 Requires: libvirt-ssh-proxy = %{version}-%{release}
937 Requires: qemu
939 %description daemon-qemu
940 Server side daemon and driver required to manage the virtualization
941 capabilities of the QEMU TCG emulators
942 %endif
944 %if %{with_qemu_kvm}
945 %package daemon-kvm
946 Summary: Server side daemon & driver required to run KVM guests
948 %if %{with_modular_daemons}
949 Requires: libvirt-daemon-common = %{version}-%{release}
950 Requires: libvirt-daemon-log = %{version}-%{release}
951 Requires: libvirt-daemon-lock = %{version}-%{release}
952 Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
953 Requires: libvirt-daemon-proxy = %{version}-%{release}
954 Recommends: libvirt-daemon = %{version}-%{release}
955 %else
956 Requires: libvirt-daemon = %{version}-%{release}
957 %endif
958 Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
959 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
960 Requires: libvirt-daemon-driver-network = %{version}-%{release}
961 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
962 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
963 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
964 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
965 Requires: libvirt-ssh-proxy = %{version}-%{release}
966 Requires: qemu-kvm
968 %description daemon-kvm
969 Server side daemon and driver required to manage the virtualization
970 capabilities of the KVM hypervisor
971 %endif
973 %if %{with_lxc}
974 %package daemon-lxc
975 Summary: Server side daemon & driver required to run LXC guests
977 %if %{with_modular_daemons}
978 Requires: libvirt-daemon-common = %{version}-%{release}
979 Requires: libvirt-daemon-proxy = %{version}-%{release}
980 Recommends: libvirt-daemon = %{version}-%{release}
981 %else
982 Requires: libvirt-daemon = %{version}-%{release}
983 %endif
984 Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
985 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
986 Requires: libvirt-daemon-driver-network = %{version}-%{release}
987 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
988 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
989 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
990 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
992 %description daemon-lxc
993 Server side daemon and driver required to manage the virtualization
994 capabilities of LXC
995 %endif
997 %if %{with_libxl}
998 %package daemon-xen
999 Summary: Server side daemon & driver required to run XEN guests
1001 %if %{with_modular_daemons}
1002 Requires: libvirt-daemon-common = %{version}-%{release}
1003 Requires: libvirt-daemon-lock = %{version}-%{release}
1004 Requires: libvirt-daemon-plugin-lockd = %{version}-%{release}
1005 Requires: libvirt-daemon-proxy = %{version}-%{release}
1006 Recommends: libvirt-daemon = %{version}-%{release}
1007 %else
1008 Requires: libvirt-daemon = %{version}-%{release}
1009 %endif
1010 Requires: libvirt-daemon-driver-libxl = %{version}-%{release}
1011 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
1012 Requires: libvirt-daemon-driver-network = %{version}-%{release}
1013 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
1014 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
1015 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
1016 Requires: xen
1018 %description daemon-xen
1019 Server side daemon and driver required to manage the virtualization
1020 capabilities of XEN
1021 %endif
1023 %if %{with_vbox}
1024 %package daemon-vbox
1025 Summary: Server side daemon & driver required to run VirtualBox guests
1027 %if %{with_modular_daemons}
1028 Requires: libvirt-daemon-common = %{version}-%{release}
1029 Requires: libvirt-daemon-proxy = %{version}-%{release}
1030 Recommends: libvirt-daemon = %{version}-%{release}
1031 %else
1032 Requires: libvirt-daemon = %{version}-%{release}
1033 %endif
1034 Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
1035 Requires: libvirt-daemon-driver-interface = %{version}-%{release}
1036 Requires: libvirt-daemon-driver-network = %{version}-%{release}
1037 Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
1038 Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
1039 Requires: libvirt-daemon-driver-secret = %{version}-%{release}
1040 Requires: libvirt-daemon-driver-storage = %{version}-%{release}
1042 %description daemon-vbox
1043 Server side daemon and driver required to manage the virtualization
1044 capabilities of VirtualBox
1045 %endif
1047 %if %{with_ch}
1048 %package daemon-driver-ch
1049 Summary: Cloud-Hypervisor driver plugin for libvirtd daemon
1050 Requires: libvirt-daemon-common = %{version}-%{release}
1051 Requires: libvirt-daemon-log = %{version}-%{release}
1052 Requires: libvirt-libs = %{version}-%{release}
1054 %description daemon-driver-ch
1055 The ch driver plugin for the libvirtd daemon, providing
1056 an implementation of the hypervisor driver APIs by
1057 Cloud-Hypervisor
1058 %endif
1061 %package client
1062 Summary: Client side utilities of the libvirt library
1063 Requires: libvirt-libs = %{version}-%{release}
1065 # Ensure smooth upgrades
1066 Obsoletes: libvirt-bash-completion < 7.3.0
1068 %description client
1069 The client binaries needed to access the virtualization
1070 capabilities of recent versions of Linux (and other OSes).
1072 %package client-qemu
1073 Summary: Additional client side utilities for QEMU
1074 Requires: libvirt-libs = %{version}-%{release}
1075 Requires: python3-libvirt >= 3.7.0
1076 Requires: python3-cryptography
1077 Requires: python3-lxml
1079 %description client-qemu
1080 The additional client binaries are used to interact
1081 with some QEMU specific features of libvirt.
1083 %package libs
1084 Summary: Client side libraries
1085 # Needed by default sasl.conf - no onerous extra deps, since
1086 # 100's of other things on a system already pull in krb5-libs
1087 Requires: cyrus-sasl-gssapi
1089 %description libs
1090 Shared libraries for accessing the libvirt daemon.
1092 %if %{with_wireshark}
1093 %package wireshark
1094 Summary: Wireshark dissector plugin for libvirt RPC transactions
1095 Requires: wireshark
1096 Requires: libvirt-libs = %{version}-%{release}
1098 %description wireshark
1099 Wireshark dissector plugin for better analysis of libvirt RPC traffic.
1100 %endif
1102 %if %{with_lxc}
1103 %package login-shell
1104 Summary: Login shell for connecting users to an LXC container
1105 Requires: libvirt-libs = %{version}-%{release}
1106 %if %{with_account_add}
1107 # For uid creation during pre
1108 Requires(pre): shadow-utils
1109 %endif
1111 %description login-shell
1112 Provides the set-uid virt-login-shell binary that is used to
1113 connect a user to an LXC container when they login, by switching
1114 namespaces.
1115 %endif
1117 %package devel
1118 Summary: Libraries, includes, etc. to compile with the libvirt library
1119 Requires: libvirt-libs = %{version}-%{release}
1120 Requires: pkgconfig
1122 %description devel
1123 Include header files & development libraries for the libvirt C library.
1125 %if %{with_sanlock}
1126 %package daemon-plugin-sanlock
1127 Summary: Sanlock lock manager plugin for QEMU driver
1128 Requires: sanlock >= 2.4
1129 #for virt-sanlock-cleanup require augeas
1130 Requires: augeas
1131 Requires: libvirt-libs = %{version}-%{release}
1132 Requires: libvirt-daemon-common = %{version}-%{release}
1133 Obsoletes: libvirt-lock-sanlock < 9.1.0
1134 Provides: libvirt-lock-sanlock = %{version}-%{release}
1136 %description daemon-plugin-sanlock
1137 Includes the Sanlock lock manager plugin for the QEMU
1138 driver
1139 %endif
1141 %package nss
1142 Summary: Libvirt plugin for Name Service Switch
1143 Requires: libvirt-daemon-driver-network = %{version}-%{release}
1145 %description nss
1146 Libvirt plugin for NSS for translating domain names into IP addresses.
1147 %endif
1149 %package ssh-proxy
1150 Summary: Libvirt SSH proxy
1151 Requires: libvirt-libs = %{version}-%{release}
1153 %description ssh-proxy
1154 Allows SSH into domains via VSOCK without need for network.
1156 %if %{with_mingw32}
1157 %package -n mingw32-libvirt
1158 Summary: %{summary}
1159 Obsoletes: mingw32-libvirt-static < 7.0.0
1160 BuildArch: noarch
1162 %description -n mingw32-libvirt
1163 MinGW Windows libvirt virtualization library.
1165 %{?mingw32_debug_package}
1166 %endif
1168 %if %{with_mingw64}
1169 %package -n mingw64-libvirt
1170 Summary: %{summary}
1171 Obsoletes: mingw64-libvirt-static < 7.0.0
1172 BuildArch: noarch
1174 %description -n mingw64-libvirt
1175 MinGW Windows libvirt virtualization library.
1177 %{?mingw64_debug_package}
1178 %endif
1180 %prep
1181 %autosetup -S git_am
1183 %build
1184 %if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel}
1185 %define supported_platform 1
1186 %else
1187 %define supported_platform 0
1188 %endif
1190 %if ! %{supported_platform}
1191 echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
1192 exit 1
1193 %endif
1195 %if %{with_qemu}
1196 %define arg_qemu -Ddriver_qemu=enabled
1197 %else
1198 %define arg_qemu -Ddriver_qemu=disabled
1199 %endif
1201 %if %{with_openvz}
1202 %define arg_openvz -Ddriver_openvz=enabled
1203 %else
1204 %define arg_openvz -Ddriver_openvz=disabled
1205 %endif
1207 %if %{with_lxc}
1208 %define arg_lxc -Ddriver_lxc=enabled
1209 %define arg_login_shell -Dlogin_shell=enabled
1210 %else
1211 %define arg_lxc -Ddriver_lxc=disabled
1212 %define arg_login_shell -Dlogin_shell=disabled
1213 %endif
1215 %if %{with_vbox}
1216 %define arg_vbox -Ddriver_vbox=enabled
1217 %else
1218 %define arg_vbox -Ddriver_vbox=disabled
1219 %endif
1221 %if %{with_libxl}
1222 %define arg_libxl -Ddriver_libxl=enabled
1223 %else
1224 %define arg_libxl -Ddriver_libxl=disabled
1225 %endif
1227 %if %{with_esx}
1228 %define arg_esx -Ddriver_esx=enabled
1229 %else
1230 %define arg_esx -Ddriver_esx=disabled
1231 %endif
1233 %if %{with_esx} || %{with_ch}
1234 %define arg_curl -Dcurl=enabled
1235 %else
1236 %define arg_curl -Dcurl=disabled
1237 %endif
1239 %if %{with_hyperv}
1240 %define arg_hyperv -Ddriver_hyperv=enabled -Dopenwsman=enabled
1241 %else
1242 %define arg_hyperv -Ddriver_hyperv=disabled -Dopenwsman=disabled
1243 %endif
1245 %if %{with_vmware}
1246 %define arg_vmware -Ddriver_vmware=enabled
1247 %else
1248 %define arg_vmware -Ddriver_vmware=disabled
1249 %endif
1251 %if %{with_ch}
1252 %define arg_ch -Ddriver_ch=enabled
1253 %else
1254 %define arg_ch -Ddriver_ch=disabled
1255 %endif
1257 %if %{with_storage_rbd}
1258 %define arg_storage_rbd -Dstorage_rbd=enabled
1259 %else
1260 %define arg_storage_rbd -Dstorage_rbd=disabled
1261 %endif
1263 %if %{with_storage_gluster}
1264 %define arg_storage_gluster -Dstorage_gluster=enabled -Dglusterfs=enabled
1265 %else
1266 %define arg_storage_gluster -Dstorage_gluster=disabled -Dglusterfs=disabled
1267 %endif
1269 %if %{with_storage_zfs}
1270 %define arg_storage_zfs -Dstorage_zfs=enabled
1271 %else
1272 %define arg_storage_zfs -Dstorage_zfs=disabled
1273 %endif
1275 %if %{with_numactl}
1276 %define arg_numactl -Dnumactl=enabled
1277 %else
1278 %define arg_numactl -Dnumactl=disabled
1279 %endif
1281 %if %{with_numad}
1282 %define arg_numad -Dnumad=enabled
1283 %else
1284 %define arg_numad -Dnumad=disabled
1285 %endif
1287 %if %{with_nbdkit}
1288 %define arg_nbdkit -Dnbdkit=enabled
1289 %else
1290 %define arg_nbdkit -Dnbdkit=disabled
1291 %endif
1293 %if %{with_nbdkit_config_default}
1294 %define arg_nbdkit_config_default -Dnbdkit_config_default=enabled
1295 %else
1296 %define arg_nbdkit_config_default -Dnbdkit_config_default=disabled
1297 %endif
1299 %if %{with_fuse}
1300 %define arg_fuse -Dfuse=enabled
1301 %else
1302 %define arg_fuse -Dfuse=disabled
1303 %endif
1305 %if %{with_sanlock}
1306 %define arg_sanlock -Dsanlock=enabled
1307 %else
1308 %define arg_sanlock -Dsanlock=disabled
1309 %endif
1311 %if %{with_firewalld_zone}
1312 %define arg_firewalld_zone -Dfirewalld_zone=enabled
1313 %else
1314 %define arg_firewalld_zone -Dfirewalld_zone=disabled
1315 %endif
1317 %if %{with_netcf}
1318 %define arg_netcf -Dnetcf=enabled
1319 %else
1320 %define arg_netcf -Dnetcf=disabled
1321 %endif
1323 %if %{with_wireshark}
1324 %define arg_wireshark -Dwireshark_dissector=enabled
1325 %else
1326 %define arg_wireshark -Dwireshark_dissector=disabled
1327 %endif
1329 %if %{with_storage_iscsi_direct}
1330 %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=enabled -Dlibiscsi=enabled
1331 %else
1332 %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled -Dlibiscsi=disabled
1333 %endif
1335 %if %{with_libssh}
1336 %define arg_libssh -Dlibssh=enabled
1337 %else
1338 %define arg_libssh -Dlibssh=disabled
1339 %endif
1341 %if %{with_libssh2}
1342 %define arg_libssh2 -Dlibssh2=enabled
1343 %else
1344 %define arg_libssh2 -Dlibssh2=disabled
1345 %endif
1347 %if %{with_modular_daemons}
1348 %define arg_remote_mode -Dremote_default_mode=direct
1349 %else
1350 %define arg_remote_mode -Dremote_default_mode=legacy
1351 %endif
1353 %if %{with_userfaultfd_sysctl}
1354 %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=enabled
1355 %else
1356 %define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=disabled
1357 %endif
1359 %define when %(date +"%%F-%%T")
1360 %define where %(hostname)
1361 %define who %{?packager}%{!?packager:Unknown}
1362 %define arg_packager -Dpackager="%{who}, %{when}, %{where}"
1363 %define arg_packager_version -Dpackager_version="%{release}"
1364 %define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux"
1366 # place macros above and build commands below this comment
1368 export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
1370 %if %{with_native}
1371 %meson \
1372 -Drunstatedir=%{_rundir} \
1373 -Dinitconfdir=%{_sysconfdir}/sysconfig \
1374 -Dunitdir=%{_unitdir} \
1375 -Dsysusersdir=%{_sysusersdir} \
1376 %{?arg_qemu} \
1377 %{?arg_openvz} \
1378 %{?arg_lxc} \
1379 %{?arg_vbox} \
1380 %{?arg_libxl} \
1381 -Dsasl=enabled \
1382 -Dpolkit=enabled \
1383 -Ddriver_libvirtd=enabled \
1384 -Ddriver_remote=enabled \
1385 -Ddriver_test=enabled \
1386 %{?arg_esx} \
1387 %{?arg_curl} \
1388 %{?arg_hyperv} \
1389 %{?arg_vmware} \
1390 %{?arg_ch} \
1391 -Ddriver_vz=disabled \
1392 -Ddriver_bhyve=disabled \
1393 %{?arg_remote_mode} \
1394 -Ddriver_interface=enabled \
1395 -Ddriver_network=enabled \
1396 -Dstorage_fs=enabled \
1397 -Dstorage_lvm=enabled \
1398 -Dstorage_iscsi=enabled \
1399 %{?arg_storage_iscsi_direct} \
1400 -Dstorage_scsi=enabled \
1401 -Dstorage_disk=enabled \
1402 -Dstorage_mpath=enabled \
1403 %{?arg_storage_rbd} \
1404 %{?arg_storage_gluster} \
1405 %{?arg_storage_zfs} \
1406 -Dstorage_vstorage=disabled \
1407 %{?arg_numactl} \
1408 %{?arg_numad} \
1409 -Dcapng=enabled \
1410 %{?arg_fuse} \
1411 %{?arg_netcf} \
1412 -Dnls=enabled \
1413 -Dselinux=enabled \
1414 %{?arg_selinux_mount} \
1415 -Dapparmor=disabled \
1416 -Dapparmor_profiles=disabled \
1417 -Dsecdriver_apparmor=disabled \
1418 -Dudev=enabled \
1419 -Djson_c=enabled \
1420 %{?arg_sanlock} \
1421 -Dlibpcap=enabled \
1422 %{?arg_nbdkit} \
1423 %{?arg_nbdkit_config_default} \
1424 -Dlibnl=enabled \
1425 -Daudit=enabled \
1426 -Ddtrace=enabled \
1427 -Dfirewalld=enabled \
1428 %{?arg_firewalld_zone} \
1429 %{?arg_wireshark} \
1430 %{?arg_libssh} \
1431 %{?arg_libssh2} \
1432 -Dpm_utils=disabled \
1433 -Dnss=enabled \
1434 %{arg_packager} \
1435 %{arg_packager_version} \
1436 -Dqemu_user=%{qemu_user} \
1437 -Dqemu_group=%{qemu_group} \
1438 -Dqemu_moddir=%{qemu_moddir} \
1439 -Dqemu_datadir=%{qemu_datadir} \
1440 -Dtls_priority=%{tls_priority} \
1441 -Dsysctl_config=enabled \
1442 %{?arg_userfaultfd_sysctl} \
1443 -Dssh_proxy=enabled \
1444 %{?enable_werror} \
1445 -Dexpensive_tests=enabled \
1446 -Dinit_script=systemd \
1447 -Dfirewall_backend_priority=%{firewall_backend_priority} \
1448 -Ddocs=enabled \
1449 -Dtests=enabled \
1450 -Drpath=disabled \
1451 %{?arg_login_shell}
1453 %meson_build
1454 %endif
1456 %if %{with_mingw32} || %{with_mingw64}
1457 %mingw_meson \
1458 --auto-features=enabled \
1459 -Ddriver_remote=enabled \
1460 -Ddriver_test=enabled \
1461 -Ddriver_esx=enabled \
1462 -Dcurl=enabled \
1463 -Ddocs=enabled \
1464 -Dapparmor=disabled \
1465 -Dapparmor_profiles=disabled \
1466 -Dattr=disabled \
1467 -Daudit=disabled \
1468 -Dbash_completion=disabled \
1469 -Dblkid=disabled \
1470 -Dcapng=disabled \
1471 -Ddriver_bhyve=disabled \
1472 -Ddriver_ch=disabled \
1473 -Ddriver_hyperv=disabled \
1474 -Ddriver_interface=disabled \
1475 -Ddriver_libvirtd=disabled \
1476 -Ddriver_libxl=disabled \
1477 -Ddriver_lxc=disabled \
1478 -Ddriver_network=disabled \
1479 -Ddriver_openvz=disabled \
1480 -Ddriver_qemu=disabled \
1481 -Ddriver_secrets=disabled \
1482 -Ddriver_vbox=disabled \
1483 -Ddriver_vmware=disabled \
1484 -Ddriver_vz=disabled \
1485 -Ddtrace=disabled \
1486 -Dexpensive_tests=disabled \
1487 -Dfirewalld=disabled \
1488 -Dfirewalld_zone=disabled \
1489 -Dfuse=disabled \
1490 -Dglusterfs=disabled \
1491 -Dhost_validate=disabled \
1492 -Djson_c=disabled \
1493 -Dlibiscsi=disabled \
1494 -Dnbdkit=disabled \
1495 -Dnbdkit_config_default=disabled \
1496 -Dlibnl=disabled \
1497 -Dlibpcap=disabled \
1498 -Dlibssh2=disabled \
1499 -Dlibssh=disabled \
1500 -Dlogin_shell=disabled \
1501 -Dnetcf=disabled \
1502 -Dnls=enabled \
1503 -Dnss=disabled \
1504 -Dnumactl=disabled \
1505 -Dnumad=disabled \
1506 -Dopenwsman=disabled \
1507 -Dpciaccess=disabled \
1508 -Dpm_utils=disabled \
1509 -Dpolkit=disabled \
1510 -Dreadline=disabled \
1511 -Drpath=disabled \
1512 -Dsanlock=disabled \
1513 -Dsasl=disabled \
1514 -Dsecdriver_apparmor=disabled \
1515 -Dsecdriver_selinux=disabled \
1516 -Dselinux=disabled \
1517 -Dstorage_dir=disabled \
1518 -Dstorage_disk=disabled \
1519 -Dstorage_fs=disabled \
1520 -Dstorage_gluster=disabled \
1521 -Dstorage_iscsi_direct=disabled \
1522 -Dstorage_iscsi=disabled \
1523 -Dstorage_lvm=disabled \
1524 -Dstorage_mpath=disabled \
1525 -Dstorage_rbd=disabled \
1526 -Dstorage_scsi=disabled \
1527 -Dstorage_vstorage=disabled \
1528 -Dstorage_zfs=disabled \
1529 -Dsysctl_config=disabled \
1530 -Duserfaultfd_sysctl=disabled \
1531 -Dssh_proxy=disabled \
1532 -Dtests=disabled \
1533 -Dudev=disabled \
1534 -Dwireshark_dissector=disabled \
1535 %{?enable_werror}
1536 %mingw_ninja
1537 %endif
1539 %install
1540 rm -fr %{buildroot}
1542 export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
1544 %if %{with_native}
1545 %meson_install
1547 # We don't want to install /etc/libvirt/qemu/networks in the main %%files list
1548 # because if the admin wants to delete the default network completely, we don't
1549 # want to end up re-incarnating it on every RPM upgrade.
1550 install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/
1551 cp $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml \
1552 $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml
1553 # libvirt saves this file with mode 0600
1554 chmod 0600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml
1556 # nwfilter files are installed in /usr/share/libvirt and copied to /etc in %%post
1557 # to avoid verification errors on changed files in /etc
1558 install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
1559 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml \
1560 $RPM_BUILD_ROOT%{_datadir}/libvirt/nwfilter/
1561 # libvirt saves these files with mode 600
1562 chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
1564 %if ! %{with_qemu}
1565 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
1566 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
1567 rm -f $RPM_BUILD_ROOT%{_sysusersdir}/libvirt-qemu.conf
1568 %endif
1569 %find_lang %{name}
1571 %if ! %{with_sanlock}
1572 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirt_sanlock.aug
1573 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
1574 %endif
1576 %if ! %{with_lxc}
1577 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
1578 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
1579 %endif
1581 %if ! %{with_qemu}
1582 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
1583 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
1584 %endif
1585 %if ! %{with_lxc}
1586 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/lxc.conf
1587 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.lxc
1588 %endif
1589 %if ! %{with_libxl}
1590 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libxl.conf
1591 rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.libxl
1592 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_libxl.aug
1593 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
1594 %endif
1595 %if ! %{with_ch}
1596 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_ch.aug
1597 rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_ch.aug
1598 %endif
1600 # Copied into libvirt-docs subpackage eventually
1601 mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt libvirt-docs
1603 %ifarch %{arches_systemtap_64bit}
1604 mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \
1605 $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp
1607 %if %{with_qemu}
1608 mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
1609 $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp
1610 %endif
1611 %endif
1612 %endif
1614 %if %{with_mingw32} || %{with_mingw64}
1615 %mingw_ninja_install
1616 %endif
1618 %if %{with_mingw32}
1619 rm -rf $RPM_BUILD_ROOT%{mingw32_sysconfdir}/libvirt/nwfilter
1620 rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/doc/*
1621 rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc/*
1622 rm -rf $RPM_BUILD_ROOT%{mingw32_libexecdir}/libvirt_iohelper.exe
1623 rm -rf $RPM_BUILD_ROOT%{mingw32_libexecdir}/libvirt-guests.sh
1624 %endif
1626 %if %{with_mingw64}
1627 rm -rf $RPM_BUILD_ROOT%{mingw64_sysconfdir}/libvirt/nwfilter
1628 rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/doc/*
1629 rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc/*
1630 rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt_iohelper.exe
1631 rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
1632 %endif
1634 %if %{with_mingw32} || %{with_mingw64}
1635 %mingw_debug_install_post
1637 %mingw_find_lang %{name}
1639 %endif
1641 %check
1643 %if %{with_native}
1644 # Building on slow archs, like emulated s390x in Fedora copr, requires
1645 # raising the test timeout
1646 export VIR_TEST_DEBUG=1
1647 %meson_test --no-suite syntax-check --timeout-multiplier 10
1648 %endif
1650 %define libvirt_rpmstatedir %{_localstatedir}/lib/rpm-state/libvirt
1652 # Mark units such that presets will later be applied to them. Meant
1653 # to be called during %pre. Units that already exist on the system
1654 # will not be marked, with the assumption that presets have already
1655 # been applied at some point in the past. This makes it safe to call
1656 # this macro for all units each time %pre runs.
1657 %define libvirt_systemd_schedule_preset() \
1658 mkdir -p %{libvirt_rpmstatedir} || : \
1659 for unit in %{?*}; do \
1660 if ! test -e %{_unitdir}/$unit; then \
1661 touch %{libvirt_rpmstatedir}/preset-$unit || : \
1662 fi \
1663 done \
1664 %{nil}
1666 # Apply presets for units that have previously been marked. Meant to
1667 # be called during %posttrans. Note that foo.service must be passed
1668 # as the first argument, before all the various foo*.socket
1669 # associated with it, for things to work correctly. This is necessary
1670 # because Also=foo.socket is usually present in foo.service's
1671 # [Install] section, and we want that configuration to take
1672 # precedence over foo.socket's own presets.
1673 %define libvirt_systemd_perform_preset() \
1674 %{?7:%{error:Too many arguments}} \
1675 for unit in %{?2} %{?3} %{?4} %{?5} %{?6} %1; do \
1676 if test -e %{libvirt_rpmstatedir}/preset-$unit; then \
1677 /usr/bin/systemctl --no-reload preset $unit || : \
1678 fi \
1679 rm -f %{libvirt_rpmstatedir}/preset-$unit \
1680 done \
1681 rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
1682 %{nil}
1684 # Mark a single unit for restart. Meant to be called during %pre.
1685 %define libvirt_systemd_schedule_restart() \
1686 mkdir -p %{libvirt_rpmstatedir} || : \
1687 touch %{libvirt_rpmstatedir}/restart-%1 || : \
1688 %{nil}
1690 # Restart a unit that was previously marked. Meant to be called
1691 # during %posttrans. If systemd is not running, no action will be
1692 # performed.
1693 %define libvirt_systemd_perform_restart() \
1694 if test -d /run/systemd/system && \
1695 test -e %{libvirt_rpmstatedir}/restart-%1; then \
1696 /usr/bin/systemctl try-restart %1 >/dev/null 2>&1 || : \
1697 fi \
1698 rm -f %{libvirt_rpmstatedir}/restart-%1 \
1699 rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
1700 %{nil}
1702 # Mark a single unit for reload. Meant to be called during %pre.
1703 %define libvirt_systemd_schedule_reload() \
1704 mkdir -p %{libvirt_rpmstatedir} || : \
1705 touch %{libvirt_rpmstatedir}/reload-%1 || : \
1706 %{nil}
1708 # Reload a unit that was previously marked. Meant to be called during
1709 # %posttrans. If systemd is not running, no action will be performed.
1710 %define libvirt_systemd_perform_reload() \
1711 if test -d /run/systemd/system && \
1712 test -e %{libvirt_rpmstatedir}/reload-%1; then \
1713 /usr/bin/systemctl try-reload-or-restart %1 >/dev/null 2>&1 || : \
1714 fi \
1715 rm -f %{libvirt_rpmstatedir}/reload-%1 \
1716 rmdir %{libvirt_rpmstatedir} 2>/dev/null || : \
1717 %{nil}
1719 # Disable a single unit, optionally stopping it if systemd is
1720 # running. Meant to be called during %preun.
1721 %define libvirt_systemd_disable() \
1722 if test -d /run/systemd/system; then \
1723 /usr/bin/systemctl --no-reload disable --now %{?*} || : \
1724 else \
1725 /usr/bin/systemctl --no-reload disable %{?*} || : \
1726 fi \
1727 %{nil}
1729 # %pre implementation for services that should be restarted on
1730 # upgrade. Note that foo.service must be passed as the first
1731 # argument, before all the various foo*.socket associated with it.
1732 %define libvirt_systemd_restart_pre() \
1733 %libvirt_systemd_schedule_preset %{?*} \
1734 %libvirt_systemd_schedule_restart %1 \
1735 %{nil}
1737 # %pre implementation for services that should be reloaded on
1738 # upgrade. Note that foo.service must be passed as the first
1739 # argument, before all the various foo*.socket associated with it.
1740 %define libvirt_systemd_reload_pre() \
1741 %libvirt_systemd_schedule_preset %{?*} \
1742 %libvirt_systemd_schedule_reload %1 \
1743 %{nil}
1745 # %pre implementation for services that should be neither restarted
1746 # nor reloaded on upgrade.
1747 %define libvirt_systemd_noaction_pre() \
1748 %libvirt_systemd_schedule_preset %{?*} \
1749 %{nil}
1751 # %posttrans implementation for all services. We can use a single
1752 # macro to cover all scenarios, because each operation will only be
1753 # performed if it had previously been scheduled. Note that
1754 # foo.service must be passed as the first argument, before all the
1755 # various foo*.socket associated with it.
1756 %define libvirt_systemd_posttrans() \
1757 %libvirt_systemd_perform_preset %{?*} \
1758 %libvirt_systemd_perform_reload %1 \
1759 %libvirt_systemd_perform_restart %1 \
1760 %{nil}
1762 # %preun implementation for all services.
1763 %define libvirt_systemd_preun() \
1764 if [ $1 -lt 1 ]; then \
1765 %libvirt_systemd_disable %{?*} \
1766 fi \
1767 %{nil}
1769 # For daemons with only UNIX sockets
1771 %define libvirt_systemd_unix_pre() %libvirt_systemd_restart_pre %1.service %1.socket %1-ro.socket %1-admin.socket
1772 %define libvirt_systemd_unix_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-ro.socket %1-admin.socket
1773 %define libvirt_systemd_unix_preun() %libvirt_systemd_preun %1.service %1.socket %1-ro.socket %1-admin.socket
1775 # For daemons with UNIX and INET sockets
1776 %define libvirt_systemd_inet_pre() %libvirt_systemd_restart_pre %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
1777 %define libvirt_systemd_inet_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
1778 %define libvirt_systemd_inet_preun() %libvirt_systemd_preun %1.service %1.socket %1-ro.socket %1-admin.socket %1-tls.socket %1-tcp.socket
1780 # For daemons with only UNIX sockets and no unprivileged read-only access
1781 %define libvirt_systemd_privileged_pre() %libvirt_systemd_reload_pre %1.service %1.socket %1-admin.socket
1782 %define libvirt_systemd_privileged_posttrans() %libvirt_systemd_posttrans %1.service %1.socket %1-admin.socket
1783 %define libvirt_systemd_privileged_preun() %libvirt_systemd_preun %1.service %1.socket %1-admin.socket
1785 # For one-shot daemons that have no associated sockets and should never be restarted
1786 %define libvirt_systemd_oneshot_pre() %libvirt_systemd_noaction_pre %1.service
1787 %define libvirt_systemd_oneshot_posttrans() %libvirt_systemd_posttrans %1.service
1788 %define libvirt_systemd_oneshot_preun() %libvirt_systemd_preun %1.service
1790 # For packages that install configuration for other daemons
1791 %define libvirt_systemd_config_pre() %libvirt_systemd_schedule_restart %1.service
1792 %define libvirt_systemd_config_posttrans() %libvirt_systemd_perform_restart %1.service
1794 %if %{with_native}
1795 %pre daemon
1796 %libvirt_sysconfig_pre libvirtd
1797 %libvirt_systemd_inet_pre libvirtd
1799 %posttrans daemon
1800 %libvirt_sysconfig_posttrans libvirtd
1801 %libvirt_systemd_inet_posttrans libvirtd
1803 %preun daemon
1804 %libvirt_systemd_inet_preun libvirtd
1806 %pre daemon-common
1807 %libvirt_sysconfig_pre libvirt-guests
1808 %libvirt_systemd_oneshot_pre libvirt-guests
1809 %if %{with_account_add}
1810 # 'libvirt' group is just to allow password-less polkit access to libvirt
1811 # daemons. The uid number is irrelevant, so we use dynamic allocation.
1812 getent group libvirt >/dev/null || groupadd -r libvirt
1813 exit 0
1814 %endif
1816 %posttrans daemon-common
1817 %libvirt_sysconfig_posttrans libvirt-guests
1818 %libvirt_systemd_oneshot_posttrans libvirt-guests
1820 %preun daemon-common
1821 %libvirt_systemd_oneshot_preun libvirt-guests
1823 %pre daemon-lock
1824 %libvirt_sysconfig_pre virtlockd
1825 %libvirt_systemd_privileged_pre virtlockd
1827 %posttrans daemon-lock
1828 %libvirt_sysconfig_posttrans virtlockd
1829 %libvirt_systemd_privileged_posttrans virtlockd
1831 %preun daemon-lock
1832 %libvirt_systemd_privileged_preun virtlockd
1834 %pre daemon-log
1835 %libvirt_sysconfig_pre virtlogd
1836 %libvirt_systemd_privileged_pre virtlogd
1838 %posttrans daemon-log
1839 %libvirt_sysconfig_posttrans virtlogd
1840 %libvirt_systemd_privileged_posttrans virtlogd
1842 %preun daemon-log
1843 %libvirt_systemd_privileged_preun virtlogd
1845 %pre daemon-proxy
1846 %libvirt_sysconfig_pre virtproxyd
1847 %libvirt_systemd_inet_pre virtproxyd
1849 %posttrans daemon-proxy
1850 %libvirt_sysconfig_posttrans virtproxyd
1851 %libvirt_systemd_inet_posttrans virtproxyd
1853 %preun daemon-proxy
1854 %libvirt_systemd_inet_preun virtproxyd
1856 %pre daemon-driver-network
1857 %libvirt_sysconfig_pre virtnetworkd
1858 %libvirt_systemd_unix_pre virtnetworkd
1860 %post daemon-driver-network
1861 %if %{with_firewalld_zone}
1862 %firewalld_reload
1863 %endif
1865 %posttrans daemon-driver-network
1866 %libvirt_sysconfig_posttrans virtnetworkd
1867 %libvirt_systemd_unix_posttrans virtnetworkd
1869 %preun daemon-driver-network
1870 %libvirt_systemd_unix_preun virtnetworkd
1872 %postun daemon-driver-network
1873 %if %{with_firewalld_zone}
1874 %firewalld_reload
1875 %endif
1877 %pre daemon-driver-nwfilter
1878 %libvirt_sysconfig_pre virtnwfilterd
1879 %libvirt_systemd_unix_pre virtnwfilterd
1881 %posttrans daemon-driver-nwfilter
1882 %libvirt_sysconfig_posttrans virtnwfilterd
1883 %libvirt_systemd_unix_posttrans virtnwfilterd
1885 %preun daemon-driver-nwfilter
1886 %libvirt_systemd_unix_preun virtnwfilterd
1888 %pre daemon-driver-nodedev
1889 %libvirt_sysconfig_pre virtnodedevd
1890 %libvirt_systemd_unix_pre virtnodedevd
1892 %posttrans daemon-driver-nodedev
1893 %libvirt_sysconfig_posttrans virtnodedevd
1894 %libvirt_systemd_unix_posttrans virtnodedevd
1896 %preun daemon-driver-nodedev
1897 %libvirt_systemd_unix_preun virtnodedevd
1899 %pre daemon-driver-interface
1900 %libvirt_sysconfig_pre virtinterfaced
1901 %libvirt_systemd_unix_pre virtinterfaced
1903 %posttrans daemon-driver-interface
1904 %libvirt_sysconfig_posttrans virtinterfaced
1905 %libvirt_systemd_unix_posttrans virtinterfaced
1907 %preun daemon-driver-interface
1908 %libvirt_systemd_unix_preun virtinterfaced
1910 %pre daemon-driver-secret
1911 %libvirt_sysconfig_pre virtsecretd
1912 %libvirt_systemd_unix_pre virtsecretd
1914 %posttrans daemon-driver-secret
1915 %libvirt_sysconfig_posttrans virtsecretd
1916 %libvirt_systemd_unix_posttrans virtsecretd
1918 %preun daemon-driver-secret
1919 %libvirt_systemd_unix_preun virtsecretd
1921 %pre daemon-driver-storage-core
1922 %libvirt_sysconfig_pre virtstoraged
1923 %libvirt_systemd_unix_pre virtstoraged
1925 %posttrans daemon-driver-storage-core
1926 %libvirt_sysconfig_posttrans virtstoraged
1927 %libvirt_systemd_unix_posttrans virtstoraged
1929 %preun daemon-driver-storage-core
1930 %libvirt_systemd_unix_preun virtstoraged
1932 %if %{with_qemu}
1933 %pre daemon-driver-qemu
1934 %libvirt_sysconfig_pre virtqemud
1935 %libvirt_systemd_unix_pre virtqemud
1937 %if %{with_account_add}
1938 # We want soft static allocation of well-known ids, as disk images
1939 # are commonly shared across NFS mounts by id rather than name.
1940 # See https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/
1941 # We can not use the sysusers_create_compat macro here as we want to keep the
1942 # specfile standalone and not relying on additionnal files.
1943 getent group 'kvm' >/dev/null || groupadd -f -g '36' -r 'kvm' || :
1944 getent group 'qemu' >/dev/null || groupadd -f -g '107' -r 'qemu' || :
1945 if ! getent passwd 'qemu' >/dev/null; then
1946 if ! getent passwd '107' >/dev/null; then
1947 useradd -r -u '107' -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || :
1948 else
1949 useradd -r -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || :
1952 exit 0
1953 %endif
1955 %posttrans daemon-driver-qemu
1956 %libvirt_sysconfig_posttrans virtqemud
1957 %libvirt_systemd_unix_posttrans virtqemud
1959 %preun daemon-driver-qemu
1960 %libvirt_systemd_unix_preun virtqemud
1961 %endif
1963 %if %{with_lxc}
1964 %pre daemon-driver-lxc
1965 %libvirt_sysconfig_pre virtlxcd
1966 %libvirt_systemd_unix_pre virtlxcd
1968 %posttrans daemon-driver-lxc
1969 %libvirt_sysconfig_posttrans virtlxcd
1970 %libvirt_systemd_unix_posttrans virtlxcd
1972 %preun daemon-driver-lxc
1973 %libvirt_systemd_unix_preun virtlxcd
1974 %endif
1976 %if %{with_vbox}
1977 %pre daemon-driver-vbox
1978 %libvirt_sysconfig_pre virtvboxd
1979 %libvirt_systemd_unix_pre virtvboxd
1981 %posttrans daemon-driver-vbox
1982 %libvirt_sysconfig_posttrans virtvboxd
1983 %libvirt_systemd_unix_posttrans virtvboxd
1985 %preun daemon-driver-vbox
1986 %libvirt_systemd_unix_preun virtvboxd
1987 %endif
1989 %if %{with_libxl}
1990 %pre daemon-driver-libxl
1991 %libvirt_sysconfig_pre virtxend
1992 %libvirt_systemd_unix_pre virtxend
1994 %posttrans daemon-driver-libxl
1995 %libvirt_sysconfig_posttrans virtxend
1996 %libvirt_systemd_unix_posttrans virtxend
1998 %preun daemon-driver-libxl
1999 %libvirt_systemd_unix_preun virtxend
2000 %endif
2002 %if %{with_ch}
2003 %pre daemon-driver-ch
2004 %libvirt_sysconfig_pre virtchd
2005 %libvirt_systemd_unix_pre virtchd
2007 %posttrans daemon-driver-ch
2008 %libvirt_sysconfig_posttrans virtchd
2009 %libvirt_systemd_unix_posttrans virtchd
2011 %preun daemon-driver-ch
2012 %libvirt_systemd_unix_preun virtchd
2013 %endif
2015 %pre daemon-config-network
2016 %libvirt_systemd_config_pre libvirtd
2017 %libvirt_systemd_config_pre virtnetworkd
2019 %post daemon-config-network
2020 if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then
2021 # see if the network used by default network creates a conflict,
2022 # and try to resolve it
2023 # NB: 192.168.122.0/24 is used in the default.xml template file;
2024 # do not modify any of those values here without also modifying
2025 # them in the template.
2026 orig_sub=122
2027 sub=${orig_sub}
2028 nl='
2030 routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
2031 case ${routes} in
2032 *"${nl}192.168.${orig_sub}.0/24${nl}"*)
2033 # there was a match, so we need to look for an unused subnet
2034 for new_sub in $(seq 124 254); do
2035 case ${routes} in
2036 *"${nl}192.168.${new_sub}.0/24${nl}"*)
2039 sub=$new_sub
2040 break;
2042 esac
2043 done
2047 esac
2049 sed -e "s/${orig_sub}/${sub}/g" \
2050 < %{_datadir}/libvirt/networks/default.xml \
2051 > %{_sysconfdir}/libvirt/qemu/networks/default.xml
2052 ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
2053 # libvirt saves this file with mode 0600
2054 chmod 0600 %{_sysconfdir}/libvirt/qemu/networks/default.xml
2057 %posttrans daemon-config-network
2058 %libvirt_systemd_config_posttrans libvirtd
2059 %libvirt_systemd_config_posttrans virtnetworkd
2061 %pre daemon-config-nwfilter
2062 %libvirt_systemd_config_pre libvirtd
2063 %libvirt_systemd_config_pre virtnwfilterd
2065 %post daemon-config-nwfilter
2066 for datadir_file in %{_datadir}/libvirt/nwfilter/*.xml; do
2067 sysconfdir_file=%{_sysconfdir}/libvirt/nwfilter/$(basename "$datadir_file")
2068 if [ ! -f "$sysconfdir_file" ]; then
2069 # libvirt saves these files with mode 600
2070 install -m 0600 "$datadir_file" "$sysconfdir_file"
2072 done
2074 %posttrans daemon-config-nwfilter
2075 %libvirt_systemd_config_posttrans libvirtd
2076 %libvirt_systemd_config_posttrans virtnwfilterd
2078 %if %{with_lxc}
2079 %pre login-shell
2080 %if %{with_account_add}
2081 getent group virtlogin >/dev/null || groupadd -r virtlogin
2082 exit 0
2083 %endif
2084 %endif
2085 %endif
2087 %if %{with_native}
2088 %files
2090 %files docs
2091 %doc AUTHORS.rst NEWS.rst README.rst
2092 %doc libvirt-docs/*
2094 %files daemon
2095 %{_unitdir}/libvirtd.service
2096 %{_unitdir}/libvirtd.socket
2097 %{_unitdir}/libvirtd-ro.socket
2098 %{_unitdir}/libvirtd-admin.socket
2099 %{_unitdir}/libvirtd-tcp.socket
2100 %{_unitdir}/libvirtd-tls.socket
2101 %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
2102 %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf
2103 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd
2104 %dir %{_datadir}/augeas/lenses
2105 %{_datadir}/augeas/lenses/libvirtd.aug
2106 %dir %{_datadir}/augeas/lenses/tests
2107 %{_datadir}/augeas/lenses/tests/test_libvirtd.aug
2108 %attr(0755, root, root) %{_sbindir}/libvirtd
2109 %{_mandir}/man8/libvirtd.8*
2111 %files daemon-common
2112 %{_unitdir}/virt-guest-shutdown.target
2113 %{_unitdir}/libvirt-guests.service
2114 %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
2115 %dir %{_datadir}/libvirt/
2116 %ghost %dir %{_rundir}/libvirt/
2117 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/common/
2118 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/
2119 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
2120 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/
2121 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
2122 %dir %attr(0711, root, root) %{_localstatedir}/cache/libvirt/
2123 %dir %attr(0755, root, root) %{_libdir}/libvirt/
2124 %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
2125 %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/
2126 %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/
2127 %dir %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/
2128 %{_datadir}/polkit-1/actions/org.libvirt.unix.policy
2129 %{_datadir}/polkit-1/actions/org.libvirt.api.policy
2130 %{_datadir}/polkit-1/rules.d/50-libvirt.rules
2131 %{_sysusersdir}/libvirt.conf
2132 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
2133 %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper
2134 %attr(0755, root, root) %{_bindir}/virt-ssh-helper
2135 %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh
2136 %{_mandir}/man1/virt-admin.1*
2137 %{_mandir}/man1/virt-host-validate.1*
2138 %{_mandir}/man8/virt-ssh-helper.8*
2139 %{_mandir}/man8/libvirt-guests.8*
2140 %{_bindir}/virt-host-validate
2141 %{_bindir}/virt-admin
2142 %{_datadir}/bash-completion/completions/virt-admin
2144 %files daemon-lock
2145 %{_unitdir}/virtlockd.service
2146 %{_unitdir}/virtlockd.socket
2147 %{_unitdir}/virtlockd-admin.socket
2148 %config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
2149 %{_datadir}/augeas/lenses/virtlockd.aug
2150 %{_datadir}/augeas/lenses/tests/test_virtlockd.aug
2151 %{_datadir}/augeas/lenses/libvirt_lockd.aug
2152 %if %{with_qemu}
2153 %{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug
2154 %endif
2155 %attr(0755, root, root) %{_sbindir}/virtlockd
2156 %{_mandir}/man8/virtlockd.8*
2158 %files daemon-plugin-lockd
2159 %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/lockd.so
2161 %files daemon-log
2162 %{_unitdir}/virtlogd.service
2163 %{_unitdir}/virtlogd.socket
2164 %{_unitdir}/virtlogd-admin.socket
2165 %config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf
2166 %{_datadir}/augeas/lenses/virtlogd.aug
2167 %{_datadir}/augeas/lenses/tests/test_virtlogd.aug
2168 %attr(0755, root, root) %{_sbindir}/virtlogd
2169 %{_mandir}/man8/virtlogd.8*
2171 %files daemon-proxy
2172 %{_unitdir}/virtproxyd.service
2173 %{_unitdir}/virtproxyd.socket
2174 %{_unitdir}/virtproxyd-ro.socket
2175 %{_unitdir}/virtproxyd-admin.socket
2176 %{_unitdir}/virtproxyd-tcp.socket
2177 %{_unitdir}/virtproxyd-tls.socket
2178 %config(noreplace) %{_sysconfdir}/libvirt/virtproxyd.conf
2179 %{_datadir}/augeas/lenses/virtproxyd.aug
2180 %{_datadir}/augeas/lenses/tests/test_virtproxyd.aug
2181 %attr(0755, root, root) %{_sbindir}/virtproxyd
2182 %{_mandir}/man8/virtproxyd.8*
2184 %files daemon-config-network
2185 %dir %{_datadir}/libvirt/networks/
2186 %{_datadir}/libvirt/networks/default.xml
2187 %ghost %{_sysconfdir}/libvirt/qemu/networks/default.xml
2188 %ghost %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml
2190 %files daemon-config-nwfilter
2191 %dir %{_datadir}/libvirt/nwfilter/
2192 %{_datadir}/libvirt/nwfilter/*.xml
2193 %ghost %{_sysconfdir}/libvirt/nwfilter/*.xml
2195 %files daemon-driver-interface
2196 %config(noreplace) %{_sysconfdir}/libvirt/virtinterfaced.conf
2197 %{_datadir}/augeas/lenses/virtinterfaced.aug
2198 %{_datadir}/augeas/lenses/tests/test_virtinterfaced.aug
2199 %{_unitdir}/virtinterfaced.service
2200 %{_unitdir}/virtinterfaced.socket
2201 %{_unitdir}/virtinterfaced-ro.socket
2202 %{_unitdir}/virtinterfaced-admin.socket
2203 %attr(0755, root, root) %{_sbindir}/virtinterfaced
2204 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/interface/
2205 %{_libdir}/libvirt/connection-driver/libvirt_driver_interface.so
2206 %{_mandir}/man8/virtinterfaced.8*
2208 %files daemon-driver-network
2209 %config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf
2210 %{_datadir}/augeas/lenses/virtnetworkd.aug
2211 %{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug
2212 %config(noreplace) %{_sysconfdir}/libvirt/network.conf
2213 %{_datadir}/augeas/lenses/libvirtd_network.aug
2214 %{_datadir}/augeas/lenses/tests/test_libvirtd_network.aug
2215 %{_unitdir}/virtnetworkd.service
2216 %{_unitdir}/virtnetworkd.socket
2217 %{_unitdir}/virtnetworkd-ro.socket
2218 %{_unitdir}/virtnetworkd-admin.socket
2219 %attr(0755, root, root) %{_sbindir}/virtnetworkd
2220 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
2221 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
2222 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
2223 %ghost %dir %{_rundir}/libvirt/network/
2224 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
2225 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/
2226 %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper
2227 %{_libdir}/libvirt/connection-driver/libvirt_driver_network.so
2228 %{_mandir}/man8/virtnetworkd.8*
2229 %if %{with_firewalld_zone}
2230 %{_prefix}/lib/firewalld/zones/libvirt.xml
2231 %{_prefix}/lib/firewalld/zones/libvirt-routed.xml
2232 %{_prefix}/lib/firewalld/policies/libvirt-routed-in.xml
2233 %{_prefix}/lib/firewalld/policies/libvirt-routed-out.xml
2234 %{_prefix}/lib/firewalld/policies/libvirt-to-host.xml
2235 %endif
2237 %files daemon-driver-nodedev
2238 %config(noreplace) %{_sysconfdir}/libvirt/virtnodedevd.conf
2239 %{_datadir}/augeas/lenses/virtnodedevd.aug
2240 %{_datadir}/augeas/lenses/tests/test_virtnodedevd.aug
2241 %{_unitdir}/virtnodedevd.service
2242 %{_unitdir}/virtnodedevd.socket
2243 %{_unitdir}/virtnodedevd-ro.socket
2244 %{_unitdir}/virtnodedevd-admin.socket
2245 %attr(0755, root, root) %{_sbindir}/virtnodedevd
2246 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/nodedev/
2247 %{_libdir}/libvirt/connection-driver/libvirt_driver_nodedev.so
2248 %{_mandir}/man8/virtnodedevd.8*
2250 %files daemon-driver-nwfilter
2251 %config(noreplace) %{_sysconfdir}/libvirt/virtnwfilterd.conf
2252 %{_datadir}/augeas/lenses/virtnwfilterd.aug
2253 %{_datadir}/augeas/lenses/tests/test_virtnwfilterd.aug
2254 %{_unitdir}/virtnwfilterd.service
2255 %{_unitdir}/virtnwfilterd.socket
2256 %{_unitdir}/virtnwfilterd-ro.socket
2257 %{_unitdir}/virtnwfilterd-admin.socket
2258 %attr(0755, root, root) %{_sbindir}/virtnwfilterd
2259 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
2260 %ghost %dir %{_rundir}/libvirt/network/
2261 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/nwfilter-binding/
2262 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/nwfilter/
2263 %{_libdir}/libvirt/connection-driver/libvirt_driver_nwfilter.so
2264 %{_mandir}/man8/virtnwfilterd.8*
2266 %files daemon-driver-secret
2267 %config(noreplace) %{_sysconfdir}/libvirt/virtsecretd.conf
2268 %{_datadir}/augeas/lenses/virtsecretd.aug
2269 %{_datadir}/augeas/lenses/tests/test_virtsecretd.aug
2270 %{_unitdir}/virtsecretd.service
2271 %{_unitdir}/virtsecretd.socket
2272 %{_unitdir}/virtsecretd-ro.socket
2273 %{_unitdir}/virtsecretd-admin.socket
2274 %attr(0755, root, root) %{_sbindir}/virtsecretd
2275 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/secrets/
2276 %ghost %dir %attr(0700, root, root) %{_rundir}/libvirt/secrets/
2277 %{_libdir}/libvirt/connection-driver/libvirt_driver_secret.so
2278 %{_mandir}/man8/virtsecretd.8*
2280 %files daemon-driver-storage
2282 %files daemon-driver-storage-core
2283 %config(noreplace) %{_sysconfdir}/libvirt/virtstoraged.conf
2284 %{_datadir}/augeas/lenses/virtstoraged.aug
2285 %{_datadir}/augeas/lenses/tests/test_virtstoraged.aug
2286 %{_unitdir}/virtstoraged.service
2287 %{_unitdir}/virtstoraged.socket
2288 %{_unitdir}/virtstoraged-ro.socket
2289 %{_unitdir}/virtstoraged-admin.socket
2290 %attr(0755, root, root) %{_sbindir}/virtstoraged
2291 %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
2292 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/storage/
2293 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/storage/autostart/
2294 %ghost %dir %{_rundir}/libvirt/storage/
2295 %{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so
2296 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so
2297 %{_mandir}/man8/virtstoraged.8*
2299 %files daemon-driver-storage-disk
2300 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_disk.so
2302 %files daemon-driver-storage-logical
2303 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_logical.so
2305 %files daemon-driver-storage-scsi
2306 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_scsi.so
2308 %files daemon-driver-storage-iscsi
2309 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_iscsi.so
2311 %if %{with_storage_iscsi_direct}
2312 %files daemon-driver-storage-iscsi-direct
2313 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_iscsi-direct.so
2314 %endif
2316 %files daemon-driver-storage-mpath
2317 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_mpath.so
2319 %if %{with_storage_gluster}
2320 %files daemon-driver-storage-gluster
2321 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_gluster.so
2322 %{_libdir}/libvirt/storage-file/libvirt_storage_file_gluster.so
2323 %endif
2325 %if %{with_storage_rbd}
2326 %files daemon-driver-storage-rbd
2327 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_rbd.so
2328 %endif
2330 %if %{with_storage_zfs}
2331 %files daemon-driver-storage-zfs
2332 %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_zfs.so
2333 %endif
2335 %if %{with_qemu}
2336 %files daemon-driver-qemu
2337 %config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
2338 %if %{with_userfaultfd_sysctl}
2339 %config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf
2340 %endif
2341 %{_datadir}/augeas/lenses/virtqemud.aug
2342 %{_datadir}/augeas/lenses/tests/test_virtqemud.aug
2343 %{_unitdir}/virtqemud.service
2344 %{_unitdir}/virtqemud.socket
2345 %{_unitdir}/virtqemud-ro.socket
2346 %{_unitdir}/virtqemud-admin.socket
2347 %attr(0755, root, root) %{_sbindir}/virtqemud
2348 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
2349 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/autostart/
2350 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
2351 %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
2352 %config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
2353 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
2354 %ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/
2355 %ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/dbus/
2356 %ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/passt/
2357 %ghost %dir %attr(0755, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/slirp/
2358 %ghost %dir %attr(0770, %{qemu_user}, %{qemu_group}) %{_rundir}/libvirt/qemu/swtpm/
2359 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
2360 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/checkpoint/
2361 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/dump/
2362 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/nvram/
2363 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ram/
2364 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/save/
2365 %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/snapshot/
2366 %dir %attr(0750, root, root) %{_localstatedir}/cache/libvirt/qemu/
2367 %{_datadir}/augeas/lenses/libvirtd_qemu.aug
2368 %{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
2369 %{_libdir}/libvirt/connection-driver/libvirt_driver_qemu.so
2370 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/swtpm/
2371 %dir %attr(0730, tss, tss) %{_localstatedir}/log/swtpm/libvirt/qemu/
2372 %{_bindir}/virt-qemu-run
2373 %{_mandir}/man1/virt-qemu-run.1*
2374 %{_mandir}/man8/virtqemud.8*
2375 %{_sysusersdir}/libvirt-qemu.conf
2376 %endif
2378 %if %{with_lxc}
2379 %files daemon-driver-lxc
2380 %config(noreplace) %{_sysconfdir}/libvirt/virtlxcd.conf
2381 %{_datadir}/augeas/lenses/virtlxcd.aug
2382 %{_datadir}/augeas/lenses/tests/test_virtlxcd.aug
2383 %{_unitdir}/virtlxcd.service
2384 %{_unitdir}/virtlxcd.socket
2385 %{_unitdir}/virtlxcd-ro.socket
2386 %{_unitdir}/virtlxcd-admin.socket
2387 %attr(0755, root, root) %{_sbindir}/virtlxcd
2388 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
2389 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/lxc/
2390 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/lxc/autostart/
2391 %config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
2392 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
2393 %ghost %dir %{_rundir}/libvirt/lxc/
2394 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/
2395 %{_datadir}/augeas/lenses/libvirtd_lxc.aug
2396 %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
2397 %attr(0755, root, root) %{_libexecdir}/libvirt_lxc
2398 %{_libdir}/libvirt/connection-driver/libvirt_driver_lxc.so
2399 %{_mandir}/man8/virtlxcd.8*
2400 %endif
2402 %if %{with_libxl}
2403 %files daemon-driver-libxl
2404 %config(noreplace) %{_sysconfdir}/libvirt/virtxend.conf
2405 %{_datadir}/augeas/lenses/virtxend.aug
2406 %{_datadir}/augeas/lenses/tests/test_virtxend.aug
2407 %{_unitdir}/virtxend.service
2408 %{_unitdir}/virtxend.socket
2409 %{_unitdir}/virtxend-ro.socket
2410 %{_unitdir}/virtxend-admin.socket
2411 %attr(0755, root, root) %{_sbindir}/virtxend
2412 %config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
2413 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
2414 %config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
2415 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/libxl/
2416 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/libxl/autostart/
2417 %{_datadir}/augeas/lenses/libvirtd_libxl.aug
2418 %{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug
2419 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/
2420 %ghost %dir %{_rundir}/libvirt/libxl/
2421 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
2422 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/channel/
2423 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/channel/target/
2424 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/dump/
2425 %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/save/
2426 %{_libdir}/libvirt/connection-driver/libvirt_driver_libxl.so
2427 %{_mandir}/man8/virtxend.8*
2428 %endif
2430 %if %{with_vbox}
2431 %files daemon-driver-vbox
2432 %config(noreplace) %{_sysconfdir}/libvirt/virtvboxd.conf
2433 %{_datadir}/augeas/lenses/virtvboxd.aug
2434 %{_datadir}/augeas/lenses/tests/test_virtvboxd.aug
2435 %{_unitdir}/virtvboxd.service
2436 %{_unitdir}/virtvboxd.socket
2437 %{_unitdir}/virtvboxd-ro.socket
2438 %{_unitdir}/virtvboxd-admin.socket
2439 %attr(0755, root, root) %{_sbindir}/virtvboxd
2440 %{_libdir}/libvirt/connection-driver/libvirt_driver_vbox.so
2441 %{_mandir}/man8/virtvboxd.8*
2442 %endif
2444 %if %{with_qemu_tcg}
2445 %files daemon-qemu
2446 %endif
2448 %if %{with_qemu_kvm}
2449 %files daemon-kvm
2450 %endif
2452 %if %{with_lxc}
2453 %files daemon-lxc
2454 %endif
2456 %if %{with_libxl}
2457 %files daemon-xen
2458 %endif
2460 %if %{with_vbox}
2461 %files daemon-vbox
2462 %endif
2464 %if %{with_sanlock}
2465 %files daemon-plugin-sanlock
2466 %if %{with_qemu}
2467 %config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
2468 %endif
2469 %if %{with_libxl}
2470 %config(noreplace) %{_sysconfdir}/libvirt/libxl-sanlock.conf
2471 %endif
2472 %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so
2473 %{_datadir}/augeas/lenses/libvirt_sanlock.aug
2474 %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug
2475 %dir %attr(0770, root, sanlock) %{_localstatedir}/lib/libvirt/sanlock
2476 %{_sbindir}/virt-sanlock-cleanup
2477 %{_mandir}/man8/virt-sanlock-cleanup.8*
2478 %attr(0755, root, root) %{_libexecdir}/libvirt_sanlock_helper
2479 %endif
2481 %if %{with_ch}
2482 %files daemon-driver-ch
2483 %attr(0755, root, root) %{_sbindir}/virtchd
2484 %config(noreplace) %{_sysconfdir}/libvirt/virtchd.conf
2485 %{_datadir}/augeas/lenses/virtchd.aug
2486 %{_datadir}/augeas/lenses/tests/test_virtchd.aug
2487 %{_unitdir}/virtchd-admin.socket
2488 %{_unitdir}/virtchd-ro.socket
2489 %{_unitdir}/virtchd.service
2490 %{_unitdir}/virtchd.socket
2491 %{_libdir}/libvirt/connection-driver/libvirt_driver_ch.so
2492 %endif
2494 %files client
2495 %{_mandir}/man1/virsh.1*
2496 %{_mandir}/man1/virt-xml-validate.1*
2497 %{_mandir}/man1/virt-pki-query-dn.1*
2498 %{_mandir}/man1/virt-pki-validate.1*
2499 %{_mandir}/man7/virkey*.7*
2500 %{_bindir}/virsh
2501 %{_bindir}/virt-xml-validate
2502 %{_bindir}/virt-pki-query-dn
2503 %{_bindir}/virt-pki-validate
2504 %{_datadir}/bash-completion/completions/virsh
2506 %if %{with_qemu}
2507 %files client-qemu
2508 %{_mandir}/man1/virt-qemu-qmp-proxy.1*
2509 %{_mandir}/man1/virt-qemu-sev-validate.1*
2510 %{_bindir}/virt-qemu-qmp-proxy
2511 %{_bindir}/virt-qemu-sev-validate
2512 %endif
2514 %files libs -f %{name}.lang
2515 %license COPYING COPYING.LESSER
2516 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
2517 %config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
2518 %config(noreplace) %{_sysconfdir}/libvirt/libvirt-admin.conf
2519 %{_libdir}/libvirt.so.*
2520 %{_libdir}/libvirt-qemu.so.*
2521 %{_libdir}/libvirt-lxc.so.*
2522 %{_libdir}/libvirt-admin.so.*
2523 %dir %{_datadir}/libvirt/
2524 %{_datadir}/libvirt/test-screenshot.png
2525 %dir %{_datadir}/libvirt/schemas/
2526 %{_datadir}/libvirt/schemas/*.rng
2527 %dir %{_datadir}/systemtap/tapset/
2528 %{_datadir}/systemtap/tapset/libvirt_probes*.stp
2529 %{_datadir}/systemtap/tapset/libvirt_functions.stp
2530 %if %{with_qemu}
2531 %{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
2532 %endif
2533 %dir %{_datadir}/libvirt/cpu_map
2534 %{_datadir}/libvirt/cpu_map/*.xml
2536 %if %{with_wireshark}
2537 %files wireshark
2538 %{wireshark_plugindir}/libvirt.so
2539 %endif
2541 %files nss
2542 %{_libdir}/libnss_libvirt.so.2
2543 %{_libdir}/libnss_libvirt_guest.so.2
2545 %files ssh-proxy
2546 %config(noreplace) %{_sysconfdir}/ssh/ssh_config.d/30-libvirt-ssh-proxy.conf
2547 %{_libexecdir}/libvirt-ssh-proxy
2549 %if %{with_lxc}
2550 %files login-shell
2551 %attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
2552 %{_libexecdir}/virt-login-shell-helper
2553 %config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
2554 %{_sysusersdir}/libvirt-login-shell.conf
2555 %{_mandir}/man1/virt-login-shell.1*
2556 %endif
2558 %files devel
2559 %{_libdir}/libvirt.so
2560 %{_libdir}/libvirt-admin.so
2561 %{_libdir}/libvirt-qemu.so
2562 %{_libdir}/libvirt-lxc.so
2563 %dir %{_includedir}/libvirt
2564 %{_includedir}/libvirt/virterror.h
2565 %{_includedir}/libvirt/libvirt.h
2566 %{_includedir}/libvirt/libvirt-admin.h
2567 %{_includedir}/libvirt/libvirt-common.h
2568 %{_includedir}/libvirt/libvirt-domain.h
2569 %{_includedir}/libvirt/libvirt-domain-checkpoint.h
2570 %{_includedir}/libvirt/libvirt-domain-snapshot.h
2571 %{_includedir}/libvirt/libvirt-event.h
2572 %{_includedir}/libvirt/libvirt-host.h
2573 %{_includedir}/libvirt/libvirt-interface.h
2574 %{_includedir}/libvirt/libvirt-network.h
2575 %{_includedir}/libvirt/libvirt-nodedev.h
2576 %{_includedir}/libvirt/libvirt-nwfilter.h
2577 %{_includedir}/libvirt/libvirt-secret.h
2578 %{_includedir}/libvirt/libvirt-storage.h
2579 %{_includedir}/libvirt/libvirt-stream.h
2580 %{_includedir}/libvirt/libvirt-qemu.h
2581 %{_includedir}/libvirt/libvirt-lxc.h
2582 %{_libdir}/pkgconfig/libvirt.pc
2583 %{_libdir}/pkgconfig/libvirt-admin.pc
2584 %{_libdir}/pkgconfig/libvirt-qemu.pc
2585 %{_libdir}/pkgconfig/libvirt-lxc.pc
2586 %dir %{_datadir}/libvirt/api/
2587 %{_datadir}/libvirt/api/libvirt-api.xml
2588 %{_datadir}/libvirt/api/libvirt-admin-api.xml
2589 %{_datadir}/libvirt/api/libvirt-qemu-api.xml
2590 %{_datadir}/libvirt/api/libvirt-lxc-api.xml
2591 %endif
2593 %if %{with_mingw32}
2594 %files -n mingw32-libvirt -f mingw32-libvirt.lang
2595 %dir %{mingw32_sysconfdir}/libvirt/
2596 %config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt.conf
2597 %config(noreplace) %{mingw32_sysconfdir}/libvirt/libvirt-admin.conf
2598 %{mingw32_bindir}/libvirt-0.dll
2599 %{mingw32_bindir}/virsh.exe
2600 %{mingw32_bindir}/virt-admin.exe
2601 %{mingw32_bindir}/virt-xml-validate
2602 %{mingw32_bindir}/virt-pki-query-dn.exe
2603 %{mingw32_bindir}/virt-pki-validate.exe
2604 %{mingw32_bindir}/libvirt-lxc-0.dll
2605 %{mingw32_bindir}/libvirt-qemu-0.dll
2606 %{mingw32_bindir}/libvirt-admin-0.dll
2607 %{mingw32_libdir}/libvirt.dll.a
2608 %{mingw32_libdir}/pkgconfig/libvirt.pc
2609 %{mingw32_libdir}/pkgconfig/libvirt-qemu.pc
2610 %{mingw32_libdir}/pkgconfig/libvirt-lxc.pc
2611 %{mingw32_libdir}/pkgconfig/libvirt-admin.pc
2612 %{mingw32_libdir}/libvirt-lxc.dll.a
2613 %{mingw32_libdir}/libvirt-qemu.dll.a
2614 %{mingw32_libdir}/libvirt-admin.dll.a
2615 %dir %{mingw32_datadir}/libvirt/
2616 %dir %{mingw32_datadir}/libvirt/schemas/
2617 %{mingw32_datadir}/libvirt/schemas/*.rng
2618 %dir %{mingw32_datadir}/libvirt/api/
2619 %{mingw32_datadir}/libvirt/api/libvirt-api.xml
2620 %{mingw32_datadir}/libvirt/api/libvirt-lxc-api.xml
2621 %{mingw32_datadir}/libvirt/api/libvirt-qemu-api.xml
2622 %{mingw32_datadir}/libvirt/api/libvirt-admin-api.xml
2623 %{mingw32_datadir}/libvirt/cpu_map/*.xml
2624 %{mingw32_datadir}/libvirt/test-screenshot.png
2625 %dir %{mingw32_includedir}/libvirt
2626 %{mingw32_includedir}/libvirt/libvirt.h
2627 %{mingw32_includedir}/libvirt/libvirt-common.h
2628 %{mingw32_includedir}/libvirt/libvirt-domain.h
2629 %{mingw32_includedir}/libvirt/libvirt-domain-checkpoint.h
2630 %{mingw32_includedir}/libvirt/libvirt-domain-snapshot.h
2631 %{mingw32_includedir}/libvirt/libvirt-event.h
2632 %{mingw32_includedir}/libvirt/libvirt-host.h
2633 %{mingw32_includedir}/libvirt/libvirt-interface.h
2634 %{mingw32_includedir}/libvirt/libvirt-network.h
2635 %{mingw32_includedir}/libvirt/libvirt-nodedev.h
2636 %{mingw32_includedir}/libvirt/libvirt-nwfilter.h
2637 %{mingw32_includedir}/libvirt/libvirt-secret.h
2638 %{mingw32_includedir}/libvirt/libvirt-storage.h
2639 %{mingw32_includedir}/libvirt/libvirt-stream.h
2640 %{mingw32_includedir}/libvirt/virterror.h
2641 %{mingw32_includedir}/libvirt/libvirt-lxc.h
2642 %{mingw32_includedir}/libvirt/libvirt-qemu.h
2643 %{mingw32_includedir}/libvirt/libvirt-admin.h
2644 %{mingw32_mandir}/man1/virsh.1*
2645 %{mingw32_mandir}/man1/virt-admin.1*
2646 %{mingw32_mandir}/man1/virt-xml-validate.1*
2647 %{mingw32_mandir}/man1/virt-pki-query-dn.1*
2648 %{mingw32_mandir}/man1/virt-pki-validate.1*
2649 %{mingw32_mandir}/man7/virkey*.7*
2650 %endif
2652 %if %{with_mingw64}
2653 %files -n mingw64-libvirt -f mingw64-libvirt.lang
2654 %dir %{mingw64_sysconfdir}/libvirt/
2655 %config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt.conf
2656 %config(noreplace) %{mingw64_sysconfdir}/libvirt/libvirt-admin.conf
2657 %{mingw64_bindir}/libvirt-0.dll
2658 %{mingw64_bindir}/virsh.exe
2659 %{mingw64_bindir}/virt-admin.exe
2660 %{mingw64_bindir}/virt-xml-validate
2661 %{mingw64_bindir}/virt-pki-query-dn.exe
2662 %{mingw64_bindir}/virt-pki-validate.exe
2663 %{mingw64_bindir}/libvirt-lxc-0.dll
2664 %{mingw64_bindir}/libvirt-qemu-0.dll
2665 %{mingw64_bindir}/libvirt-admin-0.dll
2666 %{mingw64_libdir}/libvirt.dll.a
2667 %{mingw64_libdir}/pkgconfig/libvirt.pc
2668 %{mingw64_libdir}/pkgconfig/libvirt-qemu.pc
2669 %{mingw64_libdir}/pkgconfig/libvirt-lxc.pc
2670 %{mingw64_libdir}/pkgconfig/libvirt-admin.pc
2671 %{mingw64_libdir}/libvirt-lxc.dll.a
2672 %{mingw64_libdir}/libvirt-qemu.dll.a
2673 %{mingw64_libdir}/libvirt-admin.dll.a
2674 %dir %{mingw64_datadir}/libvirt/
2675 %dir %{mingw64_datadir}/libvirt/schemas/
2676 %{mingw64_datadir}/libvirt/schemas/*.rng
2677 %dir %{mingw64_datadir}/libvirt/api/
2678 %{mingw64_datadir}/libvirt/api/libvirt-api.xml
2679 %{mingw64_datadir}/libvirt/api/libvirt-lxc-api.xml
2680 %{mingw64_datadir}/libvirt/api/libvirt-qemu-api.xml
2681 %{mingw64_datadir}/libvirt/api/libvirt-admin-api.xml
2682 %{mingw64_datadir}/libvirt/cpu_map/*.xml
2683 %{mingw64_datadir}/libvirt/test-screenshot.png
2684 %dir %{mingw64_includedir}/libvirt
2685 %{mingw64_includedir}/libvirt/libvirt.h
2686 %{mingw64_includedir}/libvirt/libvirt-common.h
2687 %{mingw64_includedir}/libvirt/libvirt-domain.h
2688 %{mingw64_includedir}/libvirt/libvirt-domain-checkpoint.h
2689 %{mingw64_includedir}/libvirt/libvirt-domain-snapshot.h
2690 %{mingw64_includedir}/libvirt/libvirt-event.h
2691 %{mingw64_includedir}/libvirt/libvirt-host.h
2692 %{mingw64_includedir}/libvirt/libvirt-interface.h
2693 %{mingw64_includedir}/libvirt/libvirt-network.h
2694 %{mingw64_includedir}/libvirt/libvirt-nodedev.h
2695 %{mingw64_includedir}/libvirt/libvirt-nwfilter.h
2696 %{mingw64_includedir}/libvirt/libvirt-secret.h
2697 %{mingw64_includedir}/libvirt/libvirt-storage.h
2698 %{mingw64_includedir}/libvirt/libvirt-stream.h
2699 %{mingw64_includedir}/libvirt/virterror.h
2700 %{mingw64_includedir}/libvirt/libvirt-lxc.h
2701 %{mingw64_includedir}/libvirt/libvirt-qemu.h
2702 %{mingw64_includedir}/libvirt/libvirt-admin.h
2703 %{mingw64_mandir}/man1/virsh.1*
2704 %{mingw64_mandir}/man1/virt-admin.1*
2705 %{mingw64_mandir}/man1/virt-xml-validate.1*
2706 %{mingw64_mandir}/man1/virt-pki-query-dn.1*
2707 %{mingw64_mandir}/man1/virt-pki-validate.1*
2708 %{mingw64_mandir}/man7/virkey*.7*
2709 %endif
2711 %changelog