# TODO:
-# libpmem (x86_64 only?)
-# plugins?
+# plugins? (probes)
#
# Conditional build:
%bcond_without sdl # SDL UI and audio support
%bcond_without iscsi # iscsi support
%bcond_without libnfs # NFS support
%bcond_without multipath # Multipath support
+%bcond_without pmem # libpmem (persistent memory) support
%bcond_without seccomp # seccomp support
%bcond_without usbredir # usb network redirection support
%bcond_without system_seabios # system seabios binary
%bcond_without snappy # snappy compression library
%bcond_without user_static # build linux-user static packages
%bcond_with lttng # lttng-ust trace backend support [needs update]
-%bcond_with systemtap # SystemTap/dtrace trace backend support
+%bcond_without systemtap # SystemTap/dtrace trace backend support
%bcond_without virgl # build virgl support
%bcond_with vxhs # Veritas HyperScale vDisk backend support (builtin; module not supported)
%bcond_without xkbcommon # xkbcommon support
%ifarch x32
%undefine with_xen
%endif
+%ifnarch %{x8664} aarch64
+%undefine with_pmem
+%endif
Summary: QEMU CPU Emulator
Summary(pl.UTF-8): QEMU - emulator procesora
Name: qemu
Version: 5.0.0
-Release: 1
+Release: 3
License: GPL v2, BSD (edk2 firmware files)
Group: Applications/Emulators
Source0: https://download.qemu.org/%{name}-%{version}.tar.xz
Source12: 99-%{name}-guest-agent.rules
Source13: %{name}-guest-agent.init
Source14: %{name}-guest-agent.logrotate
+Source15: %{name}-pr-helper.service
+Source16: %{name}-pr-helper.socket
Patch0: %{name}-cflags.patch
Patch1: %{name}-whitelist.patch
Patch2: %{name}-user-execve.patch
BuildRequires: perl-tools-pod
BuildRequires: pixman-devel >= 0.21.8
BuildRequires: pkgconfig
+%{?with_pmem:BuildRequires: pmdk-devel}
%{?with_pulseaudio:BuildRequires: pulseaudio-devel}
BuildRequires: python3 >= 1:3.5
BuildRequires: rpmbuild(macros) >= 1.644
BuildRequires: which
%{?with_virgl:BuildRequires: virglrenderer-devel}
%{?with_vte:BuildRequires: vte-devel >= 0.32.0}
-# xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn xendevicemodel [xentoolcore for xen 4.10+]
-%{?with_xen:BuildRequires: xen-devel >= 4.2}
+# xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn xendevicemodel; xentoolcore for xen 4.10+
+# min version is 4.2, more features up to 4.10
+%{?with_xen:BuildRequires: xen-devel >= 4.10}
BuildRequires: xfsprogs-devel
%{?with_xkbcommon:BuildRequires: xorg-lib-libxkbcommon-devel}
BuildRequires: xorg-lib-libX11-devel
%description module-ui-sdl -l pl.UTF-8
Sterownik interfejsu użytkownika i dźwięku SDL dla QEMU.
+%package -n systemtap-qemu
+Summary: systemtap/dtrace probes for QEMU
+Summary(pl.UTF-8): Sondy systemtap/dtrace dla QEMU
+Group: Development/Tools
+Requires: %{name}-common = %{version}-%{release}
+Requires: systemtap-client
+
+%description -n systemtap-qemu
+systemtap/dtrace probes for QEMU.
+
+%description -n systemtap-qemu -l pl.UTF-8
+Sondy systemtap/dtrace dla QEMU.
+
%prep
%setup -q
%patch0 -p1
%patch5 -p1
%patch6 -p1
-# workaround for conflict with alsa/error.h
-ln -s ../error.h qapi/error.h
+%{__sed} -i '1s,/usr/bin/env python3,%{__python3},' scripts/qemu-trace-stap
+%if %{with systemtap}
+# don't require stap binary during build
+%{__sed} -i -e "s/has 'stap'/true/" configure
+%endif
%build
build() {
%{!?with_gtk3:--disable-gtk} \
%{__enable_disable iscsi libiscsi} \
%{__enable_disable libnfs} \
+ %{__enable_disable pmem libpmem} \
--enable-lzo \
%{__enable_disable multipath mpath} \
--enable-modules \
--disable-guest-agent \
--disable-guest-agent-msi \
--disable-libnfs \
+ --disable-linux-io-uring \
--disable-mpath \
--disable-nettle \
--disable-pie \
--disable-sdl \
- --enable-slirp=internal \
+ --disable-slirp \
--disable-spice \
--disable-system \
--disable-tcmalloc \
--disable-vxhs \
--enable-user \
--disable-xkbcommon \
+ --disable-zstd \
--static
%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{systemdunitdir},/usr/lib/binfmt.d} \
- $RPM_BUILD_ROOT/etc/{qemu,sysconfig,udev/rules.d,modules-load.d,rc.d/init.d,logrotate.d} \
- $RPM_BUILD_ROOT{%{_sysconfdir}/sasl,%{_sbindir}}
+ $RPM_BUILD_ROOT/etc/{qemu,sysconfig,modules-load.d,rc.d/init.d,logrotate.d} \
+ $RPM_BUILD_ROOT{%{_sysconfdir}/sasl,/lib/udev/rules.d,%{_sbindir}}
%if %{with user_static}
%{__make} -C build-static install \
%ifarch %{ix86} %{x8664} x32
install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/modules-load.d/kvm.conf
-install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d
+install -p %{SOURCE4} $RPM_BUILD_ROOT/lib/udev/rules.d
%endif
install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/ksm.service
# For the qemu-guest-agent subpackage install the systemd
# service and udev rules.
install -p %{SOURCE11} $RPM_BUILD_ROOT%{systemdunitdir}
-install -p %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d
+install -p %{SOURCE12} $RPM_BUILD_ROOT/lib/udev/rules.d
install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/qemu-ga
install -p %{SOURCE14} $RPM_BUILD_ROOT/etc/logrotate.d/qemu-ga
+cp -p %{SOURCE15} %{SOURCE16} $RPM_BUILD_ROOT%{systemdunitdir}
+
# Install binfmt
BINFMT_CPUS=" \
%ifnarch %{ix86} %{x8664} x32
%triggerpostun common -- qemu-common < 1.6.1-4
%systemd_trigger ksm.service
%systemd_trigger ksmtuned.service
+%systemd_trigger qemu-pr-helper.service
%post user
%systemd_service_restart systemd-binfmt.service
%attr(640,root,qemu) %config(noreplace) %verify(not md5 mtime size) /etc/qemu/bridge.conf
%{systemdunitdir}/ksm.service
%{systemdunitdir}/ksmtuned.service
+%{systemdunitdir}/qemu-pr-helper.service
+%{systemdunitdir}/qemu-pr-helper.socket
%attr(755,root,root) %{_bindir}/elf2dmp
%attr(755,root,root) %{_bindir}/ivshmem-client
%attr(755,root,root) %{_bindir}/ivshmem-server
%attr(755,root,root) %{_bindir}/qemu-x86_64-static
%attr(755,root,root) %{_bindir}/qemu-xtensa-static
%attr(755,root,root) %{_bindir}/qemu-xtensaeb-static
+%attr(755,root,root) %{_bindir}/qemu-trace-stap-static
%endif
%files system-aarch64
%attr(755,root,root) %{_bindir}/qemu-system-x86_64
%ifarch %{ix86} %{x8664} x32
%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/kvm.conf
-%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/80-kvm.rules
+/lib/udev/rules.d/80-kvm.rules
%endif
%{_datadir}/%{name}/bios.bin
%{_datadir}/%{name}/bios-256k.bin
%files guest-agent
%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/99-qemu-guest-agent.rules
+%attr(755,root,root) %{_bindir}/qemu-ga
+/lib/udev/rules.d/99-qemu-guest-agent.rules
%{systemdunitdir}/qemu-guest-agent.service
%attr(754,root,root) /etc/rc.d/init.d/qemu-ga
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/qemu-ga
-%attr(755,root,root) %{_bindir}/qemu-ga
%{_mandir}/man7/qemu-ga-ref.7*
%{_mandir}/man8/qemu-ga.8*
%attr(755,root,root) %{_libdir}/%{name}/audio-sdl.so
%attr(755,root,root) %{_libdir}/%{name}/ui-sdl.so
%endif
+
+%if %{with systemtap}
+%files -n systemtap-qemu
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/qemu-trace-stap
+%{_datadir}/systemtap/tapset/qemu-*.stp
+%{_mandir}/man1/qemu-trace-stap.1*
+%endif