]> xenbits.xensource.com Git - libvirt.git/commitdiff
m4: virt-sanlock: drop check for sanlock_write_lockspace()
authorPavel Hrdina <phrdina@redhat.com>
Tue, 23 Jun 2020 22:20:08 +0000 (00:20 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 10 Jul 2020 07:40:24 +0000 (09:40 +0200)
Function sanlock_write_lockspace() was introduced in 2.7 version which
is available in all supported OSes.

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 bf8c87866e50f41e21767d6692760af0367f454a..eb05ab6934b0196b90857b861cc0e89447d3ee30 100644 (file)
@@ -30,17 +30,6 @@ AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[
     CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS"
     LIBS="$LIBS $SANLOCK_LIBS"
 
-    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
-    dnl it is safe to assume sanlock_add_lockspace_timeout is present too.
-    AC_CHECK_LIB([sanlock_client], [sanlock_write_lockspace],
-                 [sanlock_write_lockspace=yes], [sanlock_write_lockspace=no])
-    if test "x$sanlock_write_lockspace" = "xyes" ; then
-      AC_DEFINE_UNQUOTED([HAVE_SANLOCK_IO_TIMEOUT], 1,
-        [whether sanlock supports sanlock_write_lockspace])
-    fi
-
     AC_CHECK_LIB([sanlock_client], [sanlock_strerror],
                  [sanlock_strerror=yes], [sanlock_strerror=no])
     if test "x$sanlock_strerror" = "xyes" ; then
index 16d050fda1f4245e8b286f3fe75e6e2388704868..f414e3ec0736505ff83f45a72ea2b5b504589abf 100644 (file)
@@ -178,20 +178,10 @@ virLockManagerSanlockInitLockspace(virLockManagerSanlockDriverPtr driver,
 {
     int ret;
 
-#ifdef HAVE_SANLOCK_IO_TIMEOUT
     const int max_hosts = 0; /* defaults used in sanlock_init() implementation */
     const unsigned int lockspaceFlags = 0;
 
     ret = sanlock_write_lockspace(ls, max_hosts, lockspaceFlags, driver->io_timeout);
-#else
-    if (driver->io_timeout) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("unable to use io_timeout with this version of sanlock"));
-        return -ENOTSUP;
-    }
-
-    ret = sanlock_init(ls, NULL, 0, 0);
-#endif
     return ret;
 }
 
@@ -349,16 +339,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver)
      * or we can fallback to polling.
      */
  retry:
-#ifdef HAVE_SANLOCK_IO_TIMEOUT
     rv = sanlock_add_lockspace_timeout(&ls, 0, driver->io_timeout);
-#else
-    if (driver->io_timeout) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("unable to use io_timeout with this version of sanlock"));
-        goto error;
-    }
-    rv = sanlock_add_lockspace(&ls, 0);
-#endif
     if (rv < 0) {
         if (-rv == EINPROGRESS && --retries) {
             /* we have this function which blocks until lockspace change the