echo "TOOLSDIR = '$(toolsdir)'"; \
echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
echo "PKGLIBDIR = '$(pkglibdir)'"; \
+ echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
} > $@
$(REPLACE_VARS_SED): Makefile
[kvm_path="/usr/bin/kvm"])
AC_SUBST(KVM_PATH, $kvm_path)
-# ---with-lvm-stripecount=...
+# --with-lvm-stripecount=...
AC_ARG_WITH([lvm-stripecount],
[AS_HELP_STRING([--with-lvm-stripecount=NUM],
[the number of stripes to use for LVM volumes]
[lvm_stripecount="1"])
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
+# --enable-drbd-barriers
+AC_ARG_ENABLE([drbd-barriers],
+ [AS_HELP_STRING([--enable-drbd-barriers],
+ [enable the DRBD barrier functionality (>= 8.0.12) (default: enabled)])],
+ [[if test "$enableval" != no; then
+ DRBD_BARRIERS=True
+ else
+ DRBD_BARRIERS=False
+ fi
+ ]],
+ [DRBD_BARRIERS=True])
+AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
+
# Check common programs
AC_PROG_INSTALL
AC_PROG_LN_S
"--create-device"]
if size:
args.extend(["-d", "%sm" % size])
+ if not constants.DRBD_BARRIERS: # disable barriers, if configured so
+ version = cls._GetVersion()
+ # various DRBD versions support different disk barrier options;
+ # what we aim here is to revert back to the 'drain' method of
+ # disk flushes and to disable metadata barriers, in effect going
+ # back to pre-8.0.7 behaviour
+ vmaj = version['k_major']
+ vmin = version['k_minor']
+ vrel = version['k_point']
+ assert vmaj == 8
+ if vmin == 0: # 8.0.x
+ if vrel >= 12:
+ args.extend(['-i', '-m'])
+ elif vmin == 2: # 8.2.x
+ if vrel >= 7:
+ args.extend(['-i', '-m'])
+ elif vmaj >= 3: # 8.3.x or newer
+ args.extend(['-i', '-a', 'm'])
result = utils.RunCmd(args)
if result.failed:
_ThrowError("drbd%d: can't attach local disk: %s", minor, result.output)
# drbd constants
DRBD_HMAC_ALG = "md5"
DRBD_NET_PROTOCOL = "C"
+DRBD_BARRIERS = _autoconf.DRBD_BARRIERS
# file backend driver
FD_LOOP = "loop"