From 619f54d34a5b6651ad0c858ba99cb891c6db7da35f9bef19fcc6d5662d5db29d Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 2 Aug 2016 21:28:46 +0000 Subject: [PATCH] spec: fix logic that enables numactl and numad support OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=555 --- libvirt.spec | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/libvirt.spec b/libvirt.spec index 0012f6c..aff5e0a 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -44,7 +44,6 @@ %define with_storage_rbd 0 %define with_storage_sheepdog 0 %define with_storage_gluster 0 -%define with_numactl 0%{!?_without_numactl:1} %define with_apparmor 0%{!?_without_apparmor:1} # Optional bits on by default @@ -54,6 +53,7 @@ # A few optional bits off by default, we enable later %define with_cgconfig 0%{!?_without_cgconfig:0} %define with_systemd 0%{!?_without_systemd:0} +%define with_numactl 0%{!?_without_numactl:0} %define with_numad 0%{!?_without_numad:0} %define with_firewalld 0%{!?_without_firewalld:0} %define with_wireshark 0%{!?_without_wireshark:0} @@ -77,9 +77,17 @@ %endif %endif -# numactl has 'ExcludeArch s390 s390x' -%ifarch s390 s390x - %define with_numactl 0 +# Enable numactl for most architectures. Handle aarch64 separately +%ifnarch s390 s390x %arm %ix86 aarch64 + %define with_numactl 0%{!?_without_numactl:1} +%endif + +# For aarch64, numactl is only available on newer than 1320, or SLE12 +# family newer than 120100 +%ifarch aarch64 + %if 0%{?suse_version} > 1320 || ( 0%{?suse_version} == 1315 && ( 0%{?sle_version} > 120100 ) ) + %define with_numactl 0%{!?_without_numactl:1} + %endif %endif # vbox is available only on i386 x86_64 @@ -138,11 +146,19 @@ %define with_wireshark 0 # numad is used to manage the CPU and memory placement dynamically for -# qemu, lxc, and uml drivers. We'll only use it on aarch64 and x86_64 +# qemu, lxc, and uml drivers %if %{with_qemu} || %{with_lxc} || %{with_uml} - %ifarch aarch64 x86_64 +# Always enable numad on x86_64 + %ifarch x86_64 %define with_numad 0%{!?_without_numad:1} %endif +# For aarch64, enable on anything newer than 1320, or SLE12 family newer +# than 120100 + %ifarch aarch64 + %if 0%{?suse_version} > 1320 || ( 0%{?is_opensuse} == 0 && 0%{?sle_version} > 120100 ) + %define with_numad 0%{!?_without_numad:1} + %endif + %endif %endif # Force QEMU to run as qemu:qemu