mem_count is now mem_size everywhere
[ganeti-local] / lib / bdev.py
index fabba9f..3f9441d 100644 (file)
@@ -24,6 +24,7 @@
 import re
 import time
 import errno
+import shlex
 import stat
 import pyparsing as pyp
 import os
@@ -415,7 +416,7 @@ class LogicalVolume(BlockDev):
                   " in lvm.conf using either 'filter' or 'preferred_names'")
     free_size = sum([pv[0] for pv in pvs_info])
     current_pvs = len(pvlist)
-    desired_stripes = params[constants.STRIPES]
+    desired_stripes = params[constants.LDP_STRIPES]
     stripes = min(current_pvs, desired_stripes)
     if stripes < desired_stripes:
       logging.warning("Could not use %d stripes for VG %s, as only %d PVs are"
@@ -1368,10 +1369,13 @@ class DRBD8(BaseDRBD):
 
     barrier_args = \
       self._ComputeDiskBarrierArgs(vmaj, vmin, vrel,
-                                   self.params[constants.BARRIERS],
-                                   self.params[constants.NO_META_FLUSH])
+                                   self.params[constants.LDP_BARRIERS],
+                                   self.params[constants.LDP_NO_META_FLUSH])
     args.extend(barrier_args)
 
+    if self.params[constants.LDP_DISK_CUSTOM]:
+      args.extend(shlex.split(self.params[constants.LDP_DISK_CUSTOM]))
+
     result = utils.RunCmd(args)
     if result.failed:
       _ThrowError("drbd%d: can't attach local disk: %s", minor, result.output)
@@ -1468,7 +1472,7 @@ class DRBD8(BaseDRBD):
     # sync speed only after setting up both sides can race with DRBD
     # connecting, hence we set it here before telling DRBD anything
     # about its peer.
-    sync_speed = self.params.get(constants.RESYNC_RATE)
+    sync_speed = self.params.get(constants.LDP_RESYNC_RATE)
     self._SetMinorSyncSpeed(minor, sync_speed)
 
     if netutils.IP6Address.IsValid(lhost):
@@ -1495,6 +1499,10 @@ class DRBD8(BaseDRBD):
       args.append("-m")
     if hmac and secret:
       args.extend(["-a", hmac, "-x", secret])
+
+    if self.params[constants.LDP_NET_CUSTOM]:
+      args.extend(shlex.split(self.params[constants.LDP_NET_CUSTOM]))
+
     result = utils.RunCmd(args)
     if result.failed:
       _ThrowError("drbd%d: can't setup network: %s - %s",
@@ -1835,7 +1843,7 @@ class DRBD8(BaseDRBD):
       # the device
       self._SlowAssemble()
 
-    sync_speed = self.params.get(constants.RESYNC_RATE)
+    sync_speed = self.params.get(constants.LDP_RESYNC_RATE)
     self.SetSyncSpeed(sync_speed)
 
   def _SlowAssemble(self):