diff --git a/libvirt.changes b/libvirt.changes index bfa76c0..25c94cb 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -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 diff --git a/libvirt.spec b/libvirt.spec index abb9f2f..2fb36a0 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -107,7 +107,7 @@ %endif # Enable firewalld support in newer code bases -%if 0%{?suse_version} >= 1330 +%if 0%{?suse_version} >= 1500 %define with_firewalld 1 %endif @@ -167,7 +167,11 @@ %define with_cgconfig 0%{!?_without_cgconfig:1} %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 Url: http://libvirt.org/ @@ -307,6 +311,9 @@ BuildRequires: wireshark-devel >= 2.1.0 %if %{with_libssh} BuildRequires: libssh-devel >= 0.7.0 %endif +%if %{with_firewalld} +BuildRequires: firewall-macros +%endif Source0: %{name}-%{version}.tar.xz Source1: %{name}-%{version}.tar.xz.asc @@ -314,6 +321,7 @@ Source2: %{name}.keyring Source3: libvirtd-relocation-server.fw Source4: libvirt-supportconfig Source5: suse-qemu-domain-hook.py +Source6: libvirtd-relocation-server.xml Source99: baselibs.conf Source100: %{name}-rpmlintrc # 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}/rclibvirt-guests -#install firewall definitions format is described here: -#/usr/share/SuSEfirewall2/services/TEMPLATE +# install firewall services for migration ports 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 +%endif # install supportconfig plugin mkdir -p %{buildroot}/usr/lib/supportconfig/plugins @@ -1321,6 +1333,9 @@ fi %if %{with_apparmor} %apparmor_reload /etc/apparmor.d/usr.sbin.libvirtd %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 %{fillup_only -n libvirtd} %{fillup_only -n virtlockd} @@ -1459,7 +1474,13 @@ fi %config(noreplace) %{_sysconfdir}/apparmor.d/local/usr.lib.libvirt.virt-aa-helper %{_libdir}/%{name}/virt-aa-helper %endif +%if %{with_firewalld} +%dir %{_libexecdir}/firewalld +%dir %{_libexecdir}/firewalld/services +%{_libexecdir}/firewalld/services/libvirtd-relocation-server.xml +%else %config %{_fwdefdir}/libvirtd-relocation-server +%endif %dir /usr/lib/supportconfig %dir /usr/lib/supportconfig/plugins /usr/lib/supportconfig/plugins/libvirt diff --git a/libvirtd-relocation-server.xml b/libvirtd-relocation-server.xml new file mode 100644 index 0000000..20c720c --- /dev/null +++ b/libvirtd-relocation-server.xml @@ -0,0 +1,6 @@ + + + libvirtd Migration Server + Enables TCP ports for libvirtd native migration + +