diff --git a/m4/virt-sanlock.m4 b/m4/virt-sanlock.m4 index 00de7980e8..cc35b10b09 100644 --- a/m4/virt-sanlock.m4 +++ b/m4/virt-sanlock.m4 @@ -29,6 +29,10 @@ AC_DEFUN([LIBVIRT_CHECK_SANLOCK],[ #include #include ]]) + 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 diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c index 23711a75cb..9484a2e6e5 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -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. */