]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
m4: virt-sanlock: drop check for sanlock_inq_lockspace
authorPavel Hrdina <phrdina@redhat.com>
Thu, 26 Mar 2020 15:26:21 +0000 (16:26 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Jul 2020 07:40:13 +0000 (09:40 +0200)
This check was introduced by commit
<96a02703daad4dc6663165adbc0feade9900cebd> to guard calling
sanlock_inq_lockspace() function but it used SANLK_INQ_WAIT as a
parameter which was introduced later.  This was eventually fixed by
commit <238dba0f9c925359cb3b8beddd8c8ae739cb4e06>.

We can safely replace check for sanlock_inq_lockspace as that function
was introduced in sanlock-1.9.  The oldest used version, sanlock-2.2,
is by Ubuntu 16.04.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
m4/virt-sanlock.m4
src/locking/lock_driver_sanlock.c

index 00de7980e8299e357c57ce093e77f87a1e83651b..cc35b10b09fcc642a7ca36583e4d0906c358cfac 100644 (file)
@@ -29,6 +29,10 @@ AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[
       #include <stdint.h>
       #include <sanlock_admin.h>
     ]])
+    if test sanlock_inq_wait = 1; then
+      AC_DEFINE_UNQUOTED([HAVE_SANLK_INQ_WAIT], 1,
+        [whether sanlock supports SANLK_INQ_WAIT])
+    fi
 
     old_cppflags="$CPPFLAGS"
     old_libs="$LIBS"
@@ -42,14 +46,6 @@ AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[
         [whether Sanlock supports sanlock_killpath])
     fi
 
-    AC_CHECK_LIB([sanlock_client], [sanlock_inq_lockspace],
-               [sanlock_inq_lockspace=yes], [sanlock_inq_lockspace=no])
-    if test "x$sanlock_inq_lockspace" = "xyes" && \
-       test $sanlock_inq_wait = 1; then
-      AC_DEFINE_UNQUOTED([HAVE_SANLOCK_INQ_LOCKSPACE], 1,
-        [whether sanlock supports sanlock_inq_lockspace])
-    fi
-
     dnl Ideally, we would check for sanlock_add_lockspace_timeout here too, but
     dnl sanlock_write_lockspace has been introduced 2 releases after
     dnl sanlock_add_lockspace_timeout therefore if sanlock_write_lockspace is found
index 23711a75cb2d16c1f106d5fbc70c695e2c8eda70..9484a2e6e55a38a6e3ec26706d9f5dc9c112df2b 100644 (file)
@@ -361,7 +361,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver)
 #endif
     if (rv < 0) {
         if (-rv == EINPROGRESS && --retries) {
-#ifdef HAVE_SANLOCK_INQ_LOCKSPACE
+#ifdef HAVE_SANLK_INQ_WAIT
             /* we have this function which blocks until lockspace change the
              * state. It returns 0 if lockspace has been added, -ENOENT if it
              * hasn't. */