dnl SANLOCK https://fedorahosted.org/sanlock/
AC_ARG_WITH([sanlock],
- AC_HELP_STRING([--with-sanlock], [use SANLOCK for lock management @<:@default=check@:>@]),
+ AC_HELP_STRING([--with-sanlock], [build Sanlock plugin for lock management @<:@default=check@:>@]),
[],
[with_sanlock=check])
fail=1
fi])
if test "x$with_sanlock" != "xno" ; then
- AC_CHECK_LIB([sanlock], [sanlock_restrict],[
- SANLOCK_LIBS="$SANLOCK_LIBS -lsanlock"
+ AC_CHECK_LIB([sanlock_client], [sanlock_init],[
+ SANLOCK_LIBS="$SANLOCK_LIBS -lsanlock_client"
with_sanlock=yes
],[
if test "x$with_sanlock" = "xcheck" ; then
])
fi
test $fail = 1 &&
- AC_MSG_ERROR([You must install the SANLOCK development package in order to compile libvirt])
+ AC_MSG_ERROR([You must install the Sanlock development package in order to compile libvirt])
CPPFLAGS="$old_cppflags"
LIBS="$old_libs"
if test "x$with_sanlock" = "xyes" ; then
AC_DEFINE_UNQUOTED([HAVE_SANLOCK], 1,
- [whether SANLOCK is available for JSON parsing/formatting])
+ [whether Sanlock plugin for lock management is available])
fi
fi
AM_CONDITIONAL([HAVE_SANLOCK], [test "x$with_sanlock" = "xyes"])
BuildRequires: yajl-devel
%endif
%if %{with_sanlock}
-BuildRequires: sanlock-devel
+BuildRequires: sanlock-devel >= 1.8
%endif
%if %{with_libpcap}
BuildRequires: libpcap-devel
%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
Group: Development/Libraries
-Requires: sanlock
+Requires: sanlock >= 1.8
#for virt-sanlock-cleanup require augeas
Requires: augeas
Requires: %{name} = %{version}-%{release}
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
sanlock_la_CFLAGS = $(AM_CLFAGS)
sanlock_la_LDFLAGS = -module -avoid-version
-sanlock_la_LIBADD = -lsanlock \
+sanlock_la_LIBADD = -lsanlock_client \
../gnulib/lib/libgnu.la
augeas_DATA += locking/libvirt_sanlock.aug
#include <sanlock.h>
#include <sanlock_resource.h>
-#include <sanlock_direct.h>
#include <sanlock_admin.h>
#include "lock_driver.h"
}
VIR_DEBUG("Someone else just created lockspace %s", path);
} else {
- if ((rv = sanlock_direct_align(&ls.host_id_disk)) < 0) {
+ if ((rv = sanlock_align(&ls.host_id_disk)) < 0) {
if (rv <= -200)
virLockError(VIR_ERR_INTERNAL_ERROR,
_("Unable to query sector size %s: error %d"),
goto error_unlink;
}
- if ((rv = sanlock_direct_init(&ls, NULL, 0, 0, 0)) < 0) {
+ if ((rv = sanlock_init(&ls, NULL, 0, 0)) < 0) {
if (rv <= -200)
virLockError(VIR_ERR_INTERNAL_ERROR,
_("Unable to initialize lockspace %s: error %d"),
}
VIR_DEBUG("Someone else just created lockspace %s", res->disks[0].path);
} else {
- if ((rv = sanlock_direct_align(&res->disks[0])) < 0) {
+ if ((rv = sanlock_align(&res->disks[0])) < 0) {
if (rv <= -200)
virLockError(VIR_ERR_INTERNAL_ERROR,
_("Unable to query sector size %s: error %d"),
goto error_unlink;
}
- if ((rv = sanlock_direct_init(NULL, res, 0, 0, 0)) < 0) {
+ if ((rv = sanlock_init(NULL, res, 0, 0)) < 0) {
if (rv <= -200)
virLockError(VIR_ERR_INTERNAL_ERROR,
_("Unable to initialize lease %s: error %d"),