LIBVIRT_CHECK_PKG([SANLOCK], [libsanlock_client], [3.2.4])
if test "x$with_sanlock" = "xyes" ; then
- AC_CHECK_DECLS([SANLK_INQ_WAIT], [sanlock_inq_wait=1], [sanlock_inq_wait=0], [[
- #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"
CPPFLAGS="$CPPFLAGS $SANLOCK_CFLAGS"
#endif
if (rv < 0) {
if (-rv == EINPROGRESS && --retries) {
-#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. */
VIR_DEBUG("Inquiring lockspace");
if (sanlock_inq_lockspace(&ls, SANLK_INQ_WAIT) < 0)
VIR_DEBUG("Unable to inquire lockspace");
-#else
- /* fall back to polling */
- VIR_DEBUG("Sleeping for %dms", LOCKSPACE_SLEEP);
- g_usleep(LOCKSPACE_SLEEP * 1000);
-#endif
VIR_DEBUG("Retrying to add lockspace (left %d)", retries);
goto retry;
}