SHA256
1
0
forked from pool/qemu

Accepting request 345200 from home:tampakrap:branches:Virtualization

- Add systemd unit file and udev rules for qemu guest agent
  - taken from the SLE12 / Leap package, see boo#955707

- Add systemd unit file and udev rules for qemu guest agent
  - taken from the SLE12 / Leap package, see boo#955707

OBS-URL: https://build.opensuse.org/request/show/345200
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=277
This commit is contained in:
Andreas Färber 2015-11-19 13:51:50 +00:00 committed by Git OBS Bridge
parent c1d133dcea
commit e8c35c9765
7 changed files with 105 additions and 11 deletions

1
80-qemu-ga.rules Normal file
View File

@ -0,0 +1 @@
SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="qemu-ga.service"

11
qemu-ga.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=QEMU Guest Agent
Documentation=http://wiki.qemu.org/Features/QAPI/GuestAgent
BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device
After=dev-virtio\x2dports-org.qemu.guest_agent.0.device
[Service]
Type=simple
ExecStart=-/usr/bin/qemu-ga
Restart=always
RestartSec=0

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Nov 19 11:23:26 UTC 2015 - tampakrap@opensuse.org
- Add systemd unit file and udev rules for qemu guest agent
- taken from the SLE12 / Leap package, see boo#955707
-------------------------------------------------------------------
Wed Oct 28 18:53:37 UTC 2015 - afaerber@suse.de

View File

@ -62,6 +62,8 @@ Source4: qemu-kvm.1.gz
Source5: 60-kvm.rules
Source6: ksm.service
Source7: 60-kvm.x86.rules
Source8: 80-qemu-ga.rules
Source9: qemu-ga.service
# Upstream First -- http://wiki.qemu-project.org/Contribute/SubmitAPatch
# This patch queue is auto-generated from https://github.com/openSUSE/qemu
Patch0001: 0001-XXX-dont-dump-core-on-sigabort.patch
@ -497,6 +499,9 @@ This sub-package contains various tools, including a bridge helper.
Summary: Universal CPU emulator -- Guest agent
Group: System/Emulators/PC
Provides: qemu:%_bindir/qemu-ga
%if 0%{?with_systemd}
%{?systemd_requires}
%endif
%description guest-agent
QEMU is an extremely well-performing CPU emulator that allows you to
@ -890,6 +895,8 @@ install -D -m 644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/60-kvm.rules
%endif
%endif
install -D -p -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/ksm.service
install -D -p -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/80-qemu-ga.rule
install -D -p -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/qemu-ga.service
%fdupes -s $RPM_BUILD_ROOT
%else # qemu-testsuite
@ -910,9 +917,6 @@ install -D -m 644 check-report.xml %{buildroot}%{_datadir}/qemu/check-report.xml
%{_sbindir}/useradd -r -g qemu -G kvm -d / -s /sbin/nologin \
-c "qemu user" qemu
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if %{kvm_available}
%post
%if 0%{?with_systemd}
@ -933,7 +937,24 @@ fi
%verify_permissions %_libexecdir/qemu-bridge-helper
%endif
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if 0%{?with_systemd}
%service_add_pre qemu-ga.service
%preun guest-agent
%service_del_preun qemu-ga.service
%post guest-agent
if [ "$(readlink -f /proc/1/root)" = "/" ]; then
/sbin/udevadm control --reload-rules || :
/sbin/udevadm trigger || :
fi
%service_add_post qemu-ga.service
%postun guest-agent
%service_del_postun qemu-ga.service
%pre ksm
%service_add_pre ksm.service
@ -1117,8 +1138,10 @@ fi
%files guest-agent
%defattr(-, root, root)
%attr(755,root,kvm) %_bindir/qemu-ga
%if 0%{?with_systemd}
%{_unitdir}/qemu-ga.service
%{_udevrulesdir}/80-qemu-ga.rules
%files ksm
%defattr(-, root, root)
%{_unitdir}/ksm.service

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Nov 19 11:23:26 UTC 2015 - tampakrap@opensuse.org
- Add systemd unit file and udev rules for qemu guest agent
- taken from the SLE12 / Leap package, see boo#955707
-------------------------------------------------------------------
Wed Oct 28 18:53:37 UTC 2015 - afaerber@suse.de

View File

@ -62,6 +62,8 @@ Source4: qemu-kvm.1.gz
Source5: 60-kvm.rules
Source6: ksm.service
Source7: 60-kvm.x86.rules
Source8: 80-qemu-ga.rules
Source9: qemu-ga.service
# Upstream First -- http://wiki.qemu-project.org/Contribute/SubmitAPatch
# This patch queue is auto-generated from https://github.com/openSUSE/qemu
Patch0001: 0001-XXX-dont-dump-core-on-sigabort.patch
@ -497,6 +499,9 @@ This sub-package contains various tools, including a bridge helper.
Summary: Universal CPU emulator -- Guest agent
Group: System/Emulators/PC
Provides: qemu:%_bindir/qemu-ga
%if 0%{?with_systemd}
%{?systemd_requires}
%endif
%description guest-agent
QEMU is an extremely well-performing CPU emulator that allows you to
@ -890,6 +895,8 @@ install -D -m 644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/60-kvm.rules
%endif
%endif
install -D -p -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/ksm.service
install -D -p -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/80-qemu-ga.rule
install -D -p -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/qemu-ga.service
%fdupes -s $RPM_BUILD_ROOT
%else # qemu-testsuite
@ -910,9 +917,6 @@ install -D -m 644 check-report.xml %{buildroot}%{_datadir}/qemu/check-report.xml
%{_sbindir}/useradd -r -g qemu -G kvm -d / -s /sbin/nologin \
-c "qemu user" qemu
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if %{kvm_available}
%post
%if 0%{?with_systemd}
@ -933,7 +937,24 @@ fi
%verify_permissions %_libexecdir/qemu-bridge-helper
%endif
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if 0%{?with_systemd}
%service_add_pre qemu-ga.service
%preun guest-agent
%service_del_preun qemu-ga.service
%post guest-agent
if [ "$(readlink -f /proc/1/root)" = "/" ]; then
/sbin/udevadm control --reload-rules || :
/sbin/udevadm trigger || :
fi
%service_add_post qemu-ga.service
%postun guest-agent
%service_del_postun qemu-ga.service
%pre ksm
%service_add_pre ksm.service
@ -1117,8 +1138,10 @@ fi
%files guest-agent
%defattr(-, root, root)
%attr(755,root,kvm) %_bindir/qemu-ga
%if 0%{?with_systemd}
%{_unitdir}/qemu-ga.service
%{_udevrulesdir}/80-qemu-ga.rules
%files ksm
%defattr(-, root, root)
%{_unitdir}/ksm.service

View File

@ -62,6 +62,8 @@ Source4: qemu-kvm.1.gz
Source5: 60-kvm.rules
Source6: ksm.service
Source7: 60-kvm.x86.rules
Source8: 80-qemu-ga.rules
Source9: qemu-ga.service
# Upstream First -- http://wiki.qemu-project.org/Contribute/SubmitAPatch
# This patch queue is auto-generated from https://github.com/openSUSE/qemu
PATCH_FILES
@ -458,6 +460,9 @@ This sub-package contains various tools, including a bridge helper.
Summary: Universal CPU emulator -- Guest agent
Group: System/Emulators/PC
Provides: qemu:%_bindir/qemu-ga
%if 0%{?with_systemd}
%{?systemd_requires}
%endif
%description guest-agent
QEMU is an extremely well-performing CPU emulator that allows you to
@ -812,6 +817,8 @@ install -D -m 644 %{SOURCE5} %{buildroot}%{_udevrulesdir}/60-kvm.rules
%endif
%endif
install -D -p -m 0644 %{SOURCE6} %{buildroot}%{_unitdir}/ksm.service
install -D -p -m 0644 %{SOURCE8} %{buildroot}%{_udevrulesdir}/80-qemu-ga.rule
install -D -p -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/qemu-ga.service
%fdupes -s $RPM_BUILD_ROOT
%else # qemu-testsuite
@ -832,8 +839,6 @@ install -D -m 644 check-report.xml %{buildroot}%{_datadir}/qemu/check-report.xml
%{_sbindir}/useradd -r -g qemu -G kvm -d / -s /sbin/nologin \
-c "qemu user" qemu
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if %{kvm_available}
%post
@ -855,7 +860,24 @@ fi
%verify_permissions %_libexecdir/qemu-bridge-helper
%endif
%pre guest-agent
%{_bindir}/getent group kvm >/dev/null || %{_sbindir}/groupadd -r kvm 2>/dev/null
%if 0%{?with_systemd}
%service_add_pre qemu-ga.service
%preun guest-agent
%service_del_preun qemu-ga.service
%post guest-agent
if [ "$(readlink -f /proc/1/root)" = "/" ]; then
/sbin/udevadm control --reload-rules || :
/sbin/udevadm trigger || :
fi
%service_add_post qemu-ga.service
%postun guest-agent
%service_del_postun qemu-ga.service
%pre ksm
%service_add_pre ksm.service
@ -1039,8 +1061,10 @@ fi
%files guest-agent
%defattr(-, root, root)
%attr(755,root,kvm) %_bindir/qemu-ga
%if 0%{?with_systemd}
%{_unitdir}/qemu-ga.service
%{_udevrulesdir}/80-qemu-ga.rules
%files ksm
%defattr(-, root, root)
%{_unitdir}/ksm.service