diff --git a/0001-memfd-fix-configure-test.patch b/0001-memfd-fix-configure-test.patch new file mode 100644 index 0000000..b7ef1be --- /dev/null +++ b/0001-memfd-fix-configure-test.patch @@ -0,0 +1,55 @@ +From 758ec569df2da73a96bc1902b3524167d002c4c8 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 28 Nov 2017 11:51:27 +0100 +Subject: [PATCH] memfd: fix configure test +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recent glibc added memfd_create in sys/mman.h. This conflicts with +the definition in util/memfd.c: + + /builddir/build/BUILD/qemu-2.11.0-rc1/util/memfd.c:40:12: error: static declaration of memfd_create follows non-static declaration + +Fix the configure test, and remove the sys/memfd.h inclusion since the +file actually does not exist---it is a typo in the memfd_create(2) man +page. + +Cc: Marc-André Lureau +Signed-off-by: Paolo Bonzini +--- + configure | 2 +- + util/memfd.c | 4 +--- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/configure b/configure +index 6339befd8d..692ca970fd 100755 +--- a/configure ++++ b/configure +@@ -3929,7 +3929,7 @@ fi + # check if memfd is supported + memfd=no + cat > $TMPC << EOF +-#include ++#include + + int main(void) + { +diff --git a/util/memfd.c b/util/memfd.c +index 4571d1aba8..412e94a405 100644 +--- a/util/memfd.c ++++ b/util/memfd.c +@@ -31,9 +31,7 @@ + + #include "qemu/memfd.h" + +-#ifdef CONFIG_MEMFD +-#include +-#elif defined CONFIG_LINUX ++#if defined CONFIG_LINUX && !defined CONFIG_MEMFD + #include + #include + +-- +2.14.3 + diff --git a/qemu-ga.sysconfig b/qemu-ga.sysconfig new file mode 100644 index 0000000..42a818a --- /dev/null +++ b/qemu-ga.sysconfig @@ -0,0 +1,19 @@ +# This is a systemd environment file, not a shell script. +# It provides settings for "/lib/systemd/system/qemu-guest-agent.service". + +# Comma-separated blacklist of RPCs to disable, or empty list to enable all. +# +# You can get the list of RPC commands using "qemu-ga --blacklist='?'". +# There should be no spaces between commas and commands in the blacklist. +#BLACKLIST_RPC=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-exec-status + +# Fsfreeze hook script specification. +# +# FSFREEZE_HOOK_PATHNAME=/dev/null : disables the feature. +# +# FSFREEZE_HOOK_PATHNAME=/path/to/executable : enables the feature with the +# specified binary or shell script. +# +# FSFREEZE_HOOK_PATHNAME= : enables the feature with the +# default value (invoke "qemu-ga --help" to interrogate). +FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook diff --git a/qemu-guest-agent.service b/qemu-guest-agent.service index 51cd7b3..b3157d5 100644 --- a/qemu-guest-agent.service +++ b/qemu-guest-agent.service @@ -1,11 +1,19 @@ [Unit] Description=QEMU Guest Agent -BindTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device +BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device After=dev-virtio\x2dports-org.qemu.guest_agent.0.device +IgnoreOnIsolate=True [Service] -ExecStart=-/usr/bin/qemu-ga +UMask=0077 +EnvironmentFile=/etc/sysconfig/qemu-ga +ExecStart=/usr/bin/qemu-ga \ + --method=virtio-serial \ + --path=/dev/virtio-ports/org.qemu.guest_agent.0 \ + --blacklist=${BLACKLIST_RPC} \ + -F${FSFREEZE_HOOK_PATHNAME} Restart=always RestartSec=0 [Install] +WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device diff --git a/qemu.spec b/qemu.spec index ba3f367..48c5bc3 100644 --- a/qemu.spec +++ b/qemu.spec @@ -107,7 +107,7 @@ Requires: %{name}-block-ssh = %{epoch}:%{version}-%{release} Summary: QEMU is a FAST! processor emulator Name: qemu Version: 2.11.0 -Release: 0.1%{?rcrel}%{?dist} +Release: 0.2%{?rcrel}%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD URL: http://www.qemu.org/ @@ -125,6 +125,7 @@ Source8: ksmtuned Source9: ksmtuned.conf # guest agent service Source10: qemu-guest-agent.service +Source17: qemu-ga.sysconfig # guest agent udev rules Source11: 99-qemu-guest-agent.rules # /etc/qemu/bridge.conf @@ -141,6 +142,9 @@ Source21: 50-kvm-s390x.conf # /etc/security/limits.d/95-kvm-ppc64-memlock.conf Source22: 95-kvm-ppc64-memlock.conf +# fix compilation on newer glibc +Patch0001: 0001-memfd-fix-configure-test.patch + # documentation deps BuildRequires: texinfo # For /usr/bin/pod2man @@ -1145,8 +1149,14 @@ install -D -p -m 0644 %{_sourcedir}/kvm.conf %{buildroot}%{_sysconfdir}/modprobe # Install qemu-guest-agent service and udev rules install -m 0644 %{_sourcedir}/qemu-guest-agent.service %{buildroot}%{_unitdir} +install -m 0644 %{_sourcedir}/qemu-ga.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/qemu-ga install -m 0644 %{_sourcedir}/99-qemu-guest-agent.rules %{buildroot}%{_udevdir} +mkdir -p %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook.d +install -p -m 0755 scripts/qemu-guest-agent/fsfreeze-hook %{buildroot}%{_sysconfdir}/qemu-ga +install -p -m 0644 scripts/qemu-guest-agent/fsfreeze-hook.d/*.sample %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook.d/ +touch %{buildroot}%{_localstatedir}/qga-fsfreeze-hook.log + # Install qemu-pr-helper service install -m 0644 %{_sourcedir}/qemu-pr-helper.service %{buildroot}%{_unitdir} install -m 0644 %{_sourcedir}/qemu-pr-helper.socket %{buildroot}%{_unitdir} @@ -1497,6 +1507,9 @@ getent passwd qemu >/dev/null || \ %{_mandir}/man8/qemu-ga.8* %{_unitdir}/qemu-guest-agent.service %{_udevdir}/99-qemu-guest-agent.rules +%config(noreplace) %{_sysconfdir}/sysconfig/qemu-ga +%{_sysconfdir}/qemu-ga +%ghost %{_localstatedir}/qga-fsfreeze-hook.log %files img @@ -1962,6 +1975,13 @@ getent passwd qemu >/dev/null || \ %changelog +* Tue Nov 28 2017 Paolo Bonzini - 2:2.11.0-0.1.rc2 +- Fix compilation +- Upgrade qemu-ga packaging based on RHEL 7 + +* Mon Nov 20 2017 Cole Robinson - 2:2.11.0-0.1.rc1 +- Rebase to 2.11.0-rc1 + * Thu Oct 19 2017 Cole Robinson - 2:2.10.1-1 - Fix ppc64 KVM failure (bz #1501936) - CVE-2017-15038: 9p: information disclosure when reading extended