qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v3] block/gluster: Handle changed glfs_ftruncate


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v3] block/gluster: Handle changed glfs_ftruncate signature
Date: Fri, 27 Jul 2018 08:24:05 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/27/2018 03:19 AM, Niels de Vos wrote:
From: Prasanna Kumar Kalever <address@hidden>

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.


Oh, one other comment.

+++ b/block/gluster.c
@@ -20,6 +20,10 @@
  #include "qemu/option.h"
  #include "qemu/cutils.h"
+#ifdef CONFIG_GLUSTERFS_LEGACY_FTRUNCATE
+# define glfs_ftruncate(fd, offset, _u1, _u2) glfs_ftruncate(fd, offset)
+#endif

Someday, when we can assume new enough gluster everywhere, we can drop this hunk...

+++ b/configure

+       /* new glfs_ftruncate() passes two additional args */
+       return glfs_ftruncate(NULL, 0 /*, NULL, NULL */);
+}
+EOF
+    if compile_prog "$glusterfs_cflags" "$glusterfs_libs" ; then
+      glusterfs_legacy_ftruncate="yes"
+    fi

...but it will be easier to remember to do so if this comment in configure calls out the upstream gluster version that no longer requires the legacy workaround, as our hint for when...

    else
      if test "$glusterfs" = "yes" ; then
        feature_not_found "GlusterFS backend support" \
@@ -6644,6 +6658,10 @@ if test "$glusterfs_zerofill" = "yes" ; then
    echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak
  fi
+if test "$glusterfs_legacy_ftruncate" = "yes" ; then
+  echo "CONFIG_GLUSTERFS_LEGACY_FTRUNCATE=y" >> $config_host_mak

...this #define is no longer necessary.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]