From e31c43f77b8e2059e96c62d135dd7ad170529bbf Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 3 Aug 2007 09:18:13 +0000
Subject: [PATCH] Put synchronization speed into constant.

Reviewed-by: iustinp
---
 lib/backend.py   | 4 ++--
 lib/constants.py | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/backend.py b/lib/backend.py
index 6bc2bc117..ea44897d5 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -575,7 +575,7 @@ def CreateBlockDevice(disk, size, on_primary):
                      (disk, size))
   if on_primary or disk.AssembleOnSecondary():
     device.Assemble()
-    device.SetSyncSpeed(30*1024)
+    device.SetSyncSpeed(constants.SYNC_SPEED)
     if on_primary or disk.OpenOnSecondary():
       device.Open(force=True)
   physical_id = device.unique_id
@@ -630,7 +630,7 @@ def _RecursiveAssembleBD(disk, as_primary):
 
   if as_primary or disk.AssembleOnSecondary():
     r_dev = bdev.AttachOrAssemble(disk.dev_type, disk.physical_id, children)
-    r_dev.SetSyncSpeed(30*1024)
+    r_dev.SetSyncSpeed(constants.SYNC_SPEED)
     result = r_dev
     if as_primary or disk.OpenOnSecondary():
       r_dev.Open()
diff --git a/lib/constants.py b/lib/constants.py
index 211d44bf8..6103e6631 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -87,3 +87,4 @@ EXIT_NOTMASTER = 11
 
 # others
 DEFAULT_BRIDGE = "xen-br0"
+SYNC_SPEED = 30 * 1024
-- 
GitLab