Accepting request 587176 from home:jfehlig:branches:Virtualization

- Install correct firewall service file depending on availability
  of firewalld vs SuSEfirewall2
  libvirtd-relocation-server.xml
  bsc#1083455

OBS-URL: https://build.opensuse.org/request/show/587176
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=677
This commit is contained in:
James Fehlig 2018-03-14 23:03:30 +00:00 committed by Git OBS Bridge
parent a026aabb02
commit 2596895112
3 changed files with 39 additions and 4 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Mar 14 21:40:53 UTC 2018 - jfehlig@suse.com
- Install correct firewall service file depending on availability
of firewalld vs SuSEfirewall2
libvirtd-relocation-server.xml
bsc#1083455
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 14 13:52:55 UTC 2018 - jfehlig@suse.com Wed Mar 14 13:52:55 UTC 2018 - jfehlig@suse.com

View File

@ -107,7 +107,7 @@
%endif %endif
# Enable firewalld support in newer code bases # Enable firewalld support in newer code bases
%if 0%{?suse_version} >= 1330 %if 0%{?suse_version} >= 1500
%define with_firewalld 1 %define with_firewalld 1
%endif %endif
@ -167,7 +167,11 @@
%define with_cgconfig 0%{!?_without_cgconfig:1} %define with_cgconfig 0%{!?_without_cgconfig:1}
%endif %endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %if %{with_firewalld}
%define _fwdefdir %{_libexecdir}/firewalld/services
%else
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%endif
Name: libvirt Name: libvirt
Url: http://libvirt.org/ Url: http://libvirt.org/
@ -307,6 +311,9 @@ BuildRequires: wireshark-devel >= 2.1.0
%if %{with_libssh} %if %{with_libssh}
BuildRequires: libssh-devel >= 0.7.0 BuildRequires: libssh-devel >= 0.7.0
%endif %endif
%if %{with_firewalld}
BuildRequires: firewall-macros
%endif
Source0: %{name}-%{version}.tar.xz Source0: %{name}-%{version}.tar.xz
Source1: %{name}-%{version}.tar.xz.asc Source1: %{name}-%{version}.tar.xz.asc
@ -314,6 +321,7 @@ Source2: %{name}.keyring
Source3: libvirtd-relocation-server.fw Source3: libvirtd-relocation-server.fw
Source4: libvirt-supportconfig Source4: libvirt-supportconfig
Source5: suse-qemu-domain-hook.py Source5: suse-qemu-domain-hook.py
Source6: libvirtd-relocation-server.xml
Source99: baselibs.conf Source99: baselibs.conf
Source100: %{name}-rpmlintrc Source100: %{name}-rpmlintrc
# Upstream patches # Upstream patches
@ -1266,10 +1274,14 @@ ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcvirtlogd
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcvirtlockd ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rcvirtlockd
ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rclibvirt-guests ln -s %{_sbindir}/service %{buildroot}/%{_sbindir}/rclibvirt-guests
#install firewall definitions format is described here: # install firewall services for migration ports
#/usr/share/SuSEfirewall2/services/TEMPLATE
mkdir -p %{buildroot}/%{_fwdefdir} mkdir -p %{buildroot}/%{_fwdefdir}
%if %{with_firewalld}
install -m 644 %{S:6} %{buildroot}/%{_fwdefdir}/libvirtd-relocation-server.xml
%else
# Format described in /usr/share/SuSEfirewall2/services/TEMPLATE
install -m 644 %{S:3} %{buildroot}/%{_fwdefdir}/libvirtd-relocation-server install -m 644 %{S:3} %{buildroot}/%{_fwdefdir}/libvirtd-relocation-server
%endif
# install supportconfig plugin # install supportconfig plugin
mkdir -p %{buildroot}/usr/lib/supportconfig/plugins mkdir -p %{buildroot}/usr/lib/supportconfig/plugins
@ -1321,6 +1333,9 @@ fi
%if %{with_apparmor} %if %{with_apparmor}
%apparmor_reload /etc/apparmor.d/usr.sbin.libvirtd %apparmor_reload /etc/apparmor.d/usr.sbin.libvirtd
%endif %endif
%if %{with_firewalld}
%firewalld_reload
%endif
%service_add_post libvirtd.service virtlockd.service virtlockd.socket virtlogd.service virtlogd.socket virtlockd-admin.socket virtlogd-admin.socket %service_add_post libvirtd.service virtlockd.service virtlockd.socket virtlogd.service virtlogd.socket virtlockd-admin.socket virtlogd-admin.socket
%{fillup_only -n libvirtd} %{fillup_only -n libvirtd}
%{fillup_only -n virtlockd} %{fillup_only -n virtlockd}
@ -1459,7 +1474,13 @@ fi
%config(noreplace) %{_sysconfdir}/apparmor.d/local/usr.lib.libvirt.virt-aa-helper %config(noreplace) %{_sysconfdir}/apparmor.d/local/usr.lib.libvirt.virt-aa-helper
%{_libdir}/%{name}/virt-aa-helper %{_libdir}/%{name}/virt-aa-helper
%endif %endif
%if %{with_firewalld}
%dir %{_libexecdir}/firewalld
%dir %{_libexecdir}/firewalld/services
%{_libexecdir}/firewalld/services/libvirtd-relocation-server.xml
%else
%config %{_fwdefdir}/libvirtd-relocation-server %config %{_fwdefdir}/libvirtd-relocation-server
%endif
%dir /usr/lib/supportconfig %dir /usr/lib/supportconfig
%dir /usr/lib/supportconfig/plugins %dir /usr/lib/supportconfig/plugins
/usr/lib/supportconfig/plugins/libvirt /usr/lib/supportconfig/plugins/libvirt

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>libvirtd Migration Server</short>
<description>Enables TCP ports for libvirtd native migration</description>
<port protocol="tcp" port="49152-49215"/>
</service>