Revision 89b70f39

b/Makefile.am
445 445
	  echo "TOOLSDIR = '$(toolsdir)'"; \
446 446
	  echo "GNT_SCRIPTS = [$(foreach i,$(notdir $(gnt_scripts)),'$(i)',)]"; \
447 447
	  echo "PKGLIBDIR = '$(pkglibdir)'"; \
448
	  echo "DRBD_BARRIERS = $(DRBD_BARRIERS)"; \
448 449
	} > $@
449 450

  
450 451
$(REPLACE_VARS_SED): Makefile
b/configure.ac
108 108
  [kvm_path="/usr/bin/kvm"])
109 109
AC_SUBST(KVM_PATH, $kvm_path)
110 110

  
111
# ---with-lvm-stripecount=...
111
# --with-lvm-stripecount=...
112 112
AC_ARG_WITH([lvm-stripecount],
113 113
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
114 114
    [the number of stripes to use for LVM volumes]
......
118 118
  [lvm_stripecount="1"])
119 119
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
120 120

  
121
# --enable-drbd-barriers
122
AC_ARG_ENABLE([drbd-barriers],
123
  [AS_HELP_STRING([--enable-drbd-barriers],
124
    [enable the DRBD barrier functionality (>= 8.0.12) (default: enabled)])],
125
  [[if test "$enableval" != no; then
126
      DRBD_BARRIERS=True
127
    else
128
      DRBD_BARRIERS=False
129
    fi
130
  ]],
131
  [DRBD_BARRIERS=True])
132
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
133

  
121 134
# Check common programs
122 135
AC_PROG_INSTALL
123 136
AC_PROG_LN_S
b/lib/bdev.py
1215 1215
            "--create-device"]
1216 1216
    if size:
1217 1217
      args.extend(["-d", "%sm" % size])
1218
    if not constants.DRBD_BARRIERS: # disable barriers, if configured so
1219
      version = cls._GetVersion()
1220
      # various DRBD versions support different disk barrier options;
1221
      # what we aim here is to revert back to the 'drain' method of
1222
      # disk flushes and to disable metadata barriers, in effect going
1223
      # back to pre-8.0.7 behaviour
1224
      vmaj = version['k_major']
1225
      vmin = version['k_minor']
1226
      vrel = version['k_point']
1227
      assert vmaj == 8
1228
      if vmin == 0: # 8.0.x
1229
        if vrel >= 12:
1230
          args.extend(['-i', '-m'])
1231
      elif vmin == 2: # 8.2.x
1232
        if vrel >= 7:
1233
          args.extend(['-i', '-m'])
1234
      elif vmaj >= 3: # 8.3.x or newer
1235
        args.extend(['-i', '-a', 'm'])
1218 1236
    result = utils.RunCmd(args)
1219 1237
    if result.failed:
1220 1238
      _ThrowError("drbd%d: can't attach local disk: %s", minor, result.output)
b/lib/constants.py
255 255
# drbd constants
256 256
DRBD_HMAC_ALG = "md5"
257 257
DRBD_NET_PROTOCOL = "C"
258
DRBD_BARRIERS = _autoconf.DRBD_BARRIERS
258 259

  
259 260
# file backend driver
260 261
FD_LOOP = "loop"

Also available in: Unified diff