Change in vdsm[master]: lvm: Use a constant to define default vg extent size
alitke at redhat.com
alitke at redhat.com
Wed Apr 27 21:35:47 UTC 2016
Adam Litke has uploaded a new change for review.
Change subject: lvm: Use a constant to define default vg extent size
......................................................................
lvm: Use a constant to define default vg extent size
The default vg extent size has so far been defined as "128m" by means of
a default argument value in lvm.createVG. In order to test LVM we need
to know this value progmatically. Define DEFAULT_VG_EXTENT_SIZE_MB in
storage.constants and use this value when a default is needed.
Change-Id: I77d76e9c1011cb3bba41decbcb06830eaed66a6a
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M lib/vdsm/storage/constants.py
M tests/storagefakelib.py
M vdsm/storage/lvm.py
3 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/56715/1
diff --git a/lib/vdsm/storage/constants.py b/lib/vdsm/storage/constants.py
index 5115c31..99101c8 100644
--- a/lib/vdsm/storage/constants.py
+++ b/lib/vdsm/storage/constants.py
@@ -22,6 +22,7 @@
STORAGE = "Storage"
SECTOR_SIZE = 512
+DEFAULT_VG_EXTENT_SIZE_MB = 128
FILE_VOLUME_PERMISSIONS = 0o660
LEASE_FILEEXT = ".lease"
diff --git a/tests/storagefakelib.py b/tests/storagefakelib.py
index 110c60f..962a9c1 100644
--- a/tests/storagefakelib.py
+++ b/tests/storagefakelib.py
@@ -26,6 +26,7 @@
from testlib import make_file, recorded
from vdsm.storage import exception as se
+from vdsm.storage.constants import DEFAULT_VG_EXTENT_SIZE_MB
from vdsm.utils import round
from storage import lvm as real_lvm
@@ -46,7 +47,7 @@
self.lvmd = {}
def createVG(self, vgName, devices, initialTag, metadataSize,
- extentsize=128, force=False):
+ extentsize=DEFAULT_VG_EXTENT_SIZE_MB, force=False):
# Convert params from MB to bytes to match other fields
metadataSize <<= 20
extentsize <<= 20
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 61da2e2..cc0a801 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -39,6 +39,7 @@
from vdsm import constants
from vdsm.storage import exception as se
+from vdsm.storage.constants import DEFAULT_VG_EXTENT_SIZE_MB
import misc
import multipath
@@ -929,7 +930,7 @@
# Public Volume Group interface
#
-def createVG(vgName, devices, initialTag, metadataSize, extentsize="128m",
+def createVG(vgName, devices, initialTag, metadataSize, extentsize=None,
force=False):
pvs = [_fqpvname(pdev) for pdev in _normalizeargs(devices)]
_checkpvsblksize(pvs)
@@ -942,6 +943,8 @@
if rc != 0:
raise se.PhysDevInitializationError(pvs[0])
+ if extentsize is None:
+ extentsize = "%rm" % DEFAULT_VG_EXTENT_SIZE_MB
options = ["--physicalextentsize", extentsize]
if initialTag:
options.extend(("--addtag", initialTag))
--
To view, visit https://gerrit.ovirt.org/56715
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77d76e9c1011cb3bba41decbcb06830eaed66a6a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>
More information about the vdsm-patches
mailing list