From b7f00fb5d14933e2fdbaf7c24c95e81c9e7db9c0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 12 2020 12:37:05 +0000 Subject: import qemu-kvm-1.5.3-173.el7_8.3 --- diff --git a/SOURCES/kvm-gluster-Handle-changed-glfs_ftruncate-signature.patch b/SOURCES/kvm-gluster-Handle-changed-glfs_ftruncate-signature.patch new file mode 100644 index 0000000..91d711e --- /dev/null +++ b/SOURCES/kvm-gluster-Handle-changed-glfs_ftruncate-signature.patch @@ -0,0 +1,98 @@ +From c8c95fc7f40ace3e7125bcd2cbec1a7c39627503 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 14 Apr 2020 07:08:25 +0200 +Subject: [PATCH 1/2] gluster: Handle changed glfs_ftruncate signature + +RH-Author: Miroslav Rezanina +Message-id: <251e640171ad2596aa802518bbb936478c34c39c.1586442545.git.mrezanin@redhat.com> +Patchwork-id: 94621 +O-Subject: [RHEL-7.8 qemu-kvm PATCH 1/2] gluster: Handle changed glfs_ftruncate signature +Bugzilla: 1822235 +RH-Acked-by: John Snow +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Max Reitz + +From: Miroslav Rezanina + +From: Prasanna Kumar Kalever + +New versions of Glusters libgfapi.so have an updated glfs_ftruncate() +function that returns additional 'struct stat' structures to enable +advanced caching of attributes. This is useful for file servers, not so +much for QEMU. Nevertheless, the API has changed and needs to be +adopted. + +Signed-off-by: Prasanna Kumar Kalever +Signed-off-by: Niels de Vos +Signed-off-by: Kevin Wolf +(cherry picked from commit e014dbe74e0484188164c61ff6843f8a04a8cb9d) +Signed-off-by: Maxim Levitsky + +Signed-off-by: Miroslav Rezanina +--- + block/gluster.c | 5 +++++ + configure | 18 ++++++++++++++++++ + 2 files changed, 23 insertions(+) + +diff --git a/block/gluster.c b/block/gluster.c +index 86e136d..d6160af 100644 +--- a/block/gluster.c ++++ b/block/gluster.c +@@ -20,6 +20,11 @@ + #include "qemu/sockets.h" + #include "qemu/uri.h" + ++#ifdef CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT ++# define glfs_ftruncate(fd, offset) glfs_ftruncate(fd, offset, NULL, NULL) ++#endif ++ ++ + typedef struct GlusterAIOCB { + BlockDriverAIOCB common; + int64_t size; +diff --git a/configure b/configure +index 5877e82..70fd06f 100755 +--- a/configure ++++ b/configure +@@ -243,6 +243,7 @@ seccomp="" + glusterfs="" + glusterfs_discard="no" + virtio_blk_data_plane="" ++glusterfs_ftruncate_has_stat="no" + gtk="" + gtkabi="2.0" + tpm="no" +@@ -2748,6 +2749,19 @@ EOF + if $pkg_config --atleast-version=5 glusterfs-api >/dev/null 2>&1; then + glusterfs_discard="yes" + fi ++ cat > $TMPC << EOF ++#include ++ ++int ++main(void) ++{ ++ /* new glfs_ftruncate() passes two additional args */ ++ return glfs_ftruncate(NULL, 0, NULL, NULL); ++} ++EOF ++ if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then ++ glusterfs_ftruncate_has_stat="yes" ++ fi + else + if test "$glusterfs" = "yes" ; then + feature_not_found "GlusterFS backend support" +@@ -4178,6 +4192,10 @@ if test "$live_block_ops" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak + fi + ++if test "$glusterfs_ftruncate_has_stat" = "yes" ; then ++ echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak ++fi ++ + if test "$live_block_migration" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak + fi +-- +1.8.3.1 + diff --git a/SOURCES/kvm-gluster-the-glfs_io_cbk-callback-function-pointer-ad.patch b/SOURCES/kvm-gluster-the-glfs_io_cbk-callback-function-pointer-ad.patch new file mode 100644 index 0000000..67399c8 --- /dev/null +++ b/SOURCES/kvm-gluster-the-glfs_io_cbk-callback-function-pointer-ad.patch @@ -0,0 +1,112 @@ +From 0ac5c46ee89604090f766124d67b6530433140fd Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 14 Apr 2020 07:08:27 +0200 +Subject: [PATCH 2/2] gluster: the glfs_io_cbk callback function pointer adds + pre/post stat args + +RH-Author: Miroslav Rezanina +Message-id: <5ef3ecfcbfd79eda54fef2609efd3c7cb5710630.1586442545.git.mrezanin@redhat.com> +Patchwork-id: 94623 +O-Subject: [RHEL-7.8 qemu-kvm PATCH 2/2] gluster: the glfs_io_cbk callback function pointer adds pre/post stat args +Bugzilla: 1822235 +RH-Acked-by: John Snow +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Max Reitz + +From: Miroslav Rezanina + +From: Niels de Vos + +The glfs_*_async() functions do a callback once finished. This callback +has changed its arguments, pre- and post-stat structures have been +added. This makes it possible to improve caching, which is useful for +Samba and NFS-Ganesha, but not so much for QEMU. Gluster 6 is the first +release that includes these new arguments. + +With an additional detection in ./configure, the new arguments can +conditionally get included in the glfs_io_cbk handler. + +Signed-off-by: Niels de Vos +Signed-off-by: Kevin Wolf +(cherry picked from commit 0e3b891fefacc0e49f3c8ffa3a753b69eb7214d2) +Signed-off-by: Maxim Levitsky + +RHEL: first chunk of the patch was applied manually due to very +different context, for other chunks conficts were fixed. + +Signed-off-by: Miroslav Rezanina +--- + block/gluster.c | 7 ++++++- + configure | 24 ++++++++++++++++++++++++ + 2 files changed, 30 insertions(+), 1 deletion(-) + +diff --git a/block/gluster.c b/block/gluster.c +index d6160af..dba3e0a 100644 +--- a/block/gluster.c ++++ b/block/gluster.c +@@ -571,7 +571,12 @@ static const AIOCBInfo gluster_aiocb_info = { + .cancel = qemu_gluster_aio_cancel, + }; + +-static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg) ++static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, ++#ifdef CONFIG_GLUSTERFS_IOCB_HAS_STAT ++ struct glfs_stat *pre, struct glfs_stat *post, ++#endif ++ void *arg) ++ + { + GlusterAIOCB *acb = (GlusterAIOCB *)arg; + BlockDriverState *bs = acb->common.bs; +diff --git a/configure b/configure +index 70fd06f..34e3acc 100755 +--- a/configure ++++ b/configure +@@ -244,6 +244,7 @@ glusterfs="" + glusterfs_discard="no" + virtio_blk_data_plane="" + glusterfs_ftruncate_has_stat="no" ++glusterfs_iocb_has_stat="no" + gtk="" + gtkabi="2.0" + tpm="no" +@@ -2762,6 +2763,25 @@ EOF + if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then + glusterfs_ftruncate_has_stat="yes" + fi ++ cat > $TMPC << EOF ++#include ++ ++/* new glfs_io_cbk() passes two additional glfs_stat structs */ ++static void ++glusterfs_iocb(glfs_fd_t *fd, ssize_t ret, struct glfs_stat *prestat, struct glfs_stat *poststat, void *data) ++{} ++ ++int ++main(void) ++{ ++ glfs_io_cbk iocb = &glusterfs_iocb; ++ iocb(NULL, 0 , NULL, NULL, NULL); ++ return 0; ++} ++EOF ++ if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then ++ glusterfs_iocb_has_stat="yes" ++ fi + else + if test "$glusterfs" = "yes" ; then + feature_not_found "GlusterFS backend support" +@@ -4196,6 +4216,10 @@ if test "$glusterfs_ftruncate_has_stat" = "yes" ; then + echo "CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT=y" >> $config_host_mak + fi + ++if test "$glusterfs_iocb_has_stat" = "yes" ; then ++ echo "CONFIG_GLUSTERFS_IOCB_HAS_STAT=y" >> $config_host_mak ++fi ++ + if test "$live_block_migration" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak + fi +-- +1.8.3.1 + diff --git a/SPECS/qemu-kvm.spec b/SPECS/qemu-kvm.spec index 36b6477..9890e13 100644 --- a/SPECS/qemu-kvm.spec +++ b/SPECS/qemu-kvm.spec @@ -14,7 +14,7 @@ %global have_usbredir 0 %endif -%ifnarch s390 s390x %{arm} +%ifnarch s390 s390x %global have_librdma 1 %global have_tcmalloc 1 %endif @@ -41,9 +41,6 @@ %ifarch aarch64 %global kvm_target aarch64 %endif -%ifarch %{arm} - %global kvm_target arm -%endif #Versions of various parts: @@ -79,13 +76,13 @@ Obsoletes: %1 < %{obsoletes_version} \ Summary: QEMU is a machine emulator and virtualizer Name: %{pkgname}%{?pkgsuffix} Version: 1.5.3 -Release: 173%{?dist}.1 +Release: 173%{?dist}.3 # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 10 License: GPLv2 and GPLv2+ and CC-BY Group: Development/Tools URL: http://www.qemu.org/ -ExclusiveArch: x86_64 %{arm} +ExclusiveArch: x86_64 Requires: seabios-bin >= 1.7.2.2-5 Requires: sgabios-bin Requires: seavgabios-bin @@ -4032,6 +4029,10 @@ Patch1985: kvm-slirp-use-correct-size-while-emulating-commands.patch Patch1986: kvm-util-add-slirp_fmt-helpers.patch # For bz#1798970 - CVE-2020-8608 qemu-kvm: QEMU: Slirp: potential OOB access due to unsafe snprintf() usages [rhel-7.8.z] Patch1987: kvm-tcp_emu-fix-unsafe-snprintf-usages.patch +# For bz#1822235 - Add support for newer glusterfs [rhel-7.8.z] +Patch1988: kvm-gluster-Handle-changed-glfs_ftruncate-signature.patch +# For bz#1822235 - Add support for newer glusterfs [rhel-7.8.z] +Patch1989: kvm-gluster-the-glfs_io_cbk-callback-function-pointer-ad.patch BuildRequires: zlib-devel @@ -6197,6 +6198,8 @@ tar -xf %{SOURCE21} %patch1985 -p1 %patch1986 -p1 %patch1987 -p1 +%patch1988 -p1 +%patch1989 -p1 %build buildarch="%{kvm_target}-softmmu" @@ -6642,6 +6645,12 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : %{_mandir}/man8/qemu-nbd.8* %changelog +* Tue Apr 14 2020 Miroslav Rezanina - 1.5.3-173.el7_8.3 +- kvm-gluster-Handle-changed-glfs_ftruncate-signature.patch [bz#1822235] +- kvm-gluster-the-glfs_io_cbk-callback-function-pointer-ad.patch [bz#1822235] +- Resolves: bz#1822235 + (Add support for newer glusterfs [rhel-7.8.z]) + * Wed Mar 04 2020 Miroslav Rezanina - 1.5.3-173.el7_8.1 - kvm-util-add-slirp_fmt-helpers.patch [bz#1798970] - kvm-tcp_emu-fix-unsafe-snprintf-usages.patch [bz#1798970]