master - python unit test: Limit PVs to use
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9b28255aac9386...
Commit: 9b28255aac9386db6d51cd1b501a9f39e81778a5
Parent: df6f0f71b10748fb809fa4d04de7541773a83ac3
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Fri Jul 26 09:51:58 2013 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Jul 26 16:43:49 2013 -0500
python unit test: Limit PVs to use
When running in the context of the test framework
we need to limit our PVs to use to those created
in the framework.
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
test/api/pytest.sh | 13 +-
test/api/python_lvm_unit.py | 471 ++++++++++++++++++++++++++++---------------
2 files changed, 315 insertions(+), 169 deletions(-)
diff --git a/test/api/pytest.sh b/test/api/pytest.sh
index 1f6968b..791c9dc 100644
--- a/test/api/pytest.sh
+++ b/test/api/pytest.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -24,10 +24,11 @@ test -z "$python_lib" && skip
export PYTHONPATH=`dirname $python_lib`:$PYTHONPATH
+#Setup which devices the unit test can use.
+export PY_UNIT_PVS=$(cat DEVICES)
+
+
+#We will skip until we can ensure it is correct.
skip
-# skiped until fixed
-# FIXME - script must ONLY use $(cat DEVICES) as PVs
-# it must NOT create/modify/remove volumes from other places
-python_lvm_unit.py -v
-# nemiver python ../api/python_lvm_unit.py -v -f
+python_lvm_unit.py -v -f
diff --git a/test/api/python_lvm_unit.py b/test/api/python_lvm_unit.py
index cc18dce..bceb82c 100755
--- a/test/api/python_lvm_unit.py
+++ b/test/api/python_lvm_unit.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved.
#
# This file is part of LVM2.
#
@@ -16,8 +16,16 @@ import unittest
import random
import string
import lvm
+import os
# Set of basic unit tests for the python bindings.
+#
+# *** WARNING ***
+#
+# This test tries to only modify configuration for the list of allowed
+# PVs, but an error in it could potentially cause data loss if run on a
+# production system. Therefore it is strongly advised that this unit test
+# not be run on a system that contains data of value.
def rs(l=10):
@@ -27,50 +35,152 @@ def rs(l=10):
return ''.join(random.choice(string.ascii_uppercase) for x in range(l))
+def _get_allowed_devices():
+ rc = os.environ.get('PY_UNIT_PVS')
+ if rc is not None:
+ rc = rc.split(' ')
+ rc.sort()
+ return rc
+
+
+def compare_pv(r, l):
+ r_name = r.getName()
+ l_name = l.getName()
+
+ if r_name > l_name:
+ return 1
+ elif r_name == l_name:
+ return 0
+ else:
+ return -1
+
+
+class AllowedPVS(object):
+ """
+ We are only allowed to muck with certain PV, filter to only
+ the ones we can use.
+ """
+
+ def __init__(self):
+ self.handle = None
+
+ def __enter__(self):
+ rc = []
+
+ allowed_dev = _get_allowed_devices()
+
+ if allowed_dev:
+ self.handle = lvm.listPvs()
+ self.pvs_all = self.handle.open()
+
+ for p in self.pvs_all:
+ if p.getName() in allowed_dev:
+ rc.append(p)
+
+ #Sort them consistently
+ rc.sort(compare_pv)
+ return rc
+
+ def __exit__(self, t_type, value, traceback):
+ if self.handle:
+ self.pvs_all = None
+ self.handle.close()
+
+
class TestLvm(unittest.TestCase):
- (FULL_PV, THIN_PV_A, THIN_PV_B, RESIZE_PV) = (0, 1, 2, 3)
- def _get_pv_devices(self):
+ VG_P = 'py_unit_test_'
+
+ def _get_pv_device_names(self):
rc = []
- with lvm.listPvs() as pvs:
+ with AllowedPVS() as pvs:
for p in pvs:
- name = p.getName()
- self.assertTrue(name is not None and len(name) > 0)
- rc.append(name)
- p = None
+ rc.append(p.getName())
return rc
- def _createThick(self, device_list):
- vg = lvm.vgCreate('full_vg')
+ def _createThickLV(self, device_list, name):
+ vg = lvm.vgCreate(TestLvm.VG_P + "_" + name)
for d in device_list:
vg.extend(d)
- new_extent = 1024 * 1024 * 2
- vg.setExtentSize(new_extent)
- self.assertEqual(vg.getExtentSize(), new_extent)
+ vg.createLvLinear(name, vg.getSize()/2)
+ vg.close()
+ vg = None
- vg.createLvLinear('thick_lv', vg.getSize()/2)
+ def _createThinPool(self, device_list, pool_name):
+ vg = lvm.vgCreate(TestLvm.VG_P + "_" + pool_name)
+
+ for d in device_list:
+ vg.extend(d)
+
+ vg.createLvThinpool(pool_name, vg.getSize()/2, 0, 0,
+ lvm.THIN_DISCARDS_PASSDOWN, 1)
+ return vg
+
+ def _createThinLV(self, pv_devices, name):
+ thin_pool_name = 'thin_vg_pool_' + rs(4)
+ vg = self._createThinPool(pv_devices, thin_pool_name)
+ vg.createLvThin(thin_pool_name, name, vg.getSize()/8)
vg.close()
vg = None
- def _removeThick(self):
- vg_name = 'full_vg'
+ def _vg_names(self):
+ rc = []
+ vg_names = lvm.listVgNames()
+
+ for i in vg_names:
+ if i[0:len(TestLvm.VG_P)] == TestLvm.VG_P:
+ rc.append(i)
+
+ return rc
+
+ def _get_lv(self, lv_vol_type=None, lv_name=None):
+ vg_name_list = self._vg_names()
+ for vg_name in vg_name_list:
+ vg = lvm.vgOpen(vg_name, "w")
+ lvs = vg.listLVs()
+
+ for l in lvs:
+ attr = l.getAttr()
+ if lv_vol_type or lv_name:
+ if lv_vol_type is not None and attr[0] == lv_vol_type:
+ return l, vg
+ elif lv_name is not None and lv_name == l.getName():
+ return l, vg
+ else:
+ return l, vg
+ vg.close()
+ return None, None
+
+ def _remove_VG(self, vg_name):
vg = lvm.vgOpen(vg_name, 'w')
pvs = vg.listPVs()
- lvs = vg.listLVs()
pe_devices = []
#Remove old snapshots first, then lv
- for l in lvs:
+ for l in vg.listLVs():
attr = l.getAttr()
if attr[0] == 's':
l.remove()
+ lvs = vg.listLVs()
+
+ #Now remove any thin lVs
+ for l in vg.listLVs():
+ attr = l.getAttr()
+ if attr[0] == 'V':
+ l.remove()
+
+ #now remove the rest
for l in vg.listLVs():
- l.remove()
+ name = l.getName()
+
+ #Don't remove the hidden ones
+ if 'tmeta' not in name and 'tdata' not in name:
+ l.remove()
for p in pvs:
pe_devices.append(p.getName())
@@ -81,37 +191,31 @@ class TestLvm(unittest.TestCase):
vg.remove()
vg.close()
+ def _clean_up(self):
+ #Clear out the testing PVs, but only if they contain stuff
+ #this unit test created
+ for vg_n in self._vg_names():
+ self._remove_VG(vg_n)
+
def setUp(self):
- device_list = self._get_pv_devices()
+ device_list = self._get_pv_device_names()
- #Make sure our prepare script is doing as expected.
+ #Make sure we have an adequate number of PVs to use
self.assertTrue(len(device_list) >= 4)
+ self._clean_up()
- vg_names = lvm.listVgNames()
-
- #If we don't have any volume groups lets setup one for
- #those tests that are expecting one
- if len(vg_names) == 0:
- self._createThick([device_list[TestLvm.FULL_PV]])
-
- vg = lvm.vgCreate('thin_vg')
- vg.extend(device_list[TestLvm.THIN_PV_A])
- vg.extend(device_list[TestLvm.THIN_PV_B])
- vg.createLvThinpool('thin_pool', vg.getSize()/2, 0, 0,
- lvm.THIN_DISCARDS_PASSDOWN, 1)
- vg.createLvThin('thin_pool', 'thin_lv', vg.getSize()/3)
- vg.close()
- vg = None
+ def tearDown(self):
+ self._clean_up()
def testPVresize(self):
- with lvm.listPvs() as pvs:
- pv = pvs[TestLvm.RESIZE_PV]
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
curr_size = pv.getSize()
dev_size = pv.getDevSize()
self.assertTrue(curr_size == dev_size)
pv.resize(curr_size/2)
- with lvm.listPvs() as pvs:
- pv = pvs[TestLvm.RESIZE_PV]
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
resized_size = pv.getSize()
self.assertTrue(resized_size != curr_size)
pv.resize(dev_size)
@@ -120,29 +224,29 @@ class TestLvm(unittest.TestCase):
"""
Test removing and re-creating a PV
"""
- target = None
+ target_name = None
- with lvm.listPvs() as pvs:
- pv = pvs[TestLvm.RESIZE_PV]
- target = pv.getName()
- lvm.pvRemove(target)
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
+ target_name = pv.getName()
+ lvm.pvRemove(target_name)
- with lvm.listPvs() as pvs:
+ with AllowedPVS() as pvs:
for p in pvs:
- self.assertTrue(p.getName() != target)
+ self.assertTrue(p.getName() != target_name)
- lvm.pvCreate(target, 0)
+ lvm.pvCreate(target_name, 0)
- with lvm.listPvs() as pvs:
+ with AllowedPVS() as pvs:
found = False
for p in pvs:
- if p.getName() == target:
+ if p.getName() == target_name:
found = True
self.assertTrue(found)
def testPvMethods(self):
- with lvm.listPvs() as pvs:
+ with AllowedPVS() as pvs:
for p in pvs:
p.getName()
p.getUuid()
@@ -152,74 +256,32 @@ class TestLvm(unittest.TestCase):
p.getFree()
p = None
- def tearDown(self):
- pass
-
- def testOpenClose(self):
- pass
-
def testVersion(self):
version = lvm.getVersion()
self.assertNotEquals(version, None)
self.assertEquals(type(version), str)
self.assertTrue(len(version) > 0)
- def testVgOpen(self):
- vg_names = lvm.listVgNames()
-
- for i in vg_names:
- vg = lvm.vgOpen(i)
- vg.close()
-
- def _get_lv_test(self, lv_vol_type=None, lv_name=None):
- vg_name_list = lvm.listVgNames()
- for vgname in vg_name_list:
- vg = lvm.vgOpen(vgname, "w")
- lvs = vg.listLVs()
-
- for l in lvs:
- attr = l.getAttr()
- if lv_vol_type or lv_name:
- if lv_vol_type is not None and attr[0] == lv_vol_type:
- return l, vg
- elif lv_name is not None and lv_name == l.getName():
- return l, vg
- else:
- return l, vg
- vg.close()
- return None, None
-
- def _get_pv_test(self):
- vg_name_list = lvm.listVgNames()
- for vgname in vg_name_list:
- vg = lvm.vgOpen(vgname, "w")
- pvs = vg.listPVs()
- if len(pvs):
- return pvs[0], vg
- return None, None
-
def testPvGetters(self):
- pv, vg = self._get_pv_test()
-
- self.assertEqual(type(pv.getName()), str)
- self.assertTrue(len(pv.getName()) > 0)
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
+ self.assertEqual(type(pv.getName()), str)
+ self.assertTrue(len(pv.getName()) > 0)
- self.assertEqual(type(pv.getUuid()), str)
- self.assertTrue(len(pv.getUuid()) > 0)
+ self.assertEqual(type(pv.getUuid()), str)
+ self.assertTrue(len(pv.getUuid()) > 0)
- self.assertTrue(type(pv.getMdaCount()) == int or
- type(pv.getMdaCount()) == long)
+ self.assertTrue(type(pv.getMdaCount()) == int or
+ type(pv.getMdaCount()) == long)
- self.assertTrue(type(pv.getSize()) == int or
- type(pv.getSize()) == long)
+ self.assertTrue(type(pv.getSize()) == int or
+ type(pv.getSize()) == long)
- self.assertTrue(type(pv.getDevSize()) == int or
- type(pv.getSize()) == long)
+ self.assertTrue(type(pv.getDevSize()) == int or
+ type(pv.getSize()) == long)
- self.assertTrue(type(pv.getFree()) == int or
- type(pv.getFree()) == long)
-
- vg.close()
+ self.assertTrue(type(pv.getFree()) == int or
+ type(pv.getFree()) == long)
def _test_prop(self, prop_obj, prop, var_type, settable):
result = prop_obj.getProperty(prop)
@@ -229,34 +291,38 @@ class TestLvm(unittest.TestCase):
self.assertTrue(result[1] == settable)
def testPvSegs(self):
- pv, vg = self._get_pv_test()
- pv_segs = pv.listPVsegs()
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
+ pv_segs = pv.listPVsegs()
- #LVsegs returns a tuple, (value, bool settable)
-
- #TODO: Test other properties of pv_seg
- for i in pv_segs:
- self._test_prop(i, 'pvseg_start', long, False)
-
- vg.close()
+ #LVsegs returns a tuple, (value, bool settable)
+ #TODO: Test other properties of pv_seg
+ for i in pv_segs:
+ self._test_prop(i, 'pvseg_start', long, False)
def testPvProperty(self):
- pv, vg = self._get_pv_test()
- self._test_prop(pv, 'pv_mda_count', long, False)
- vg.close()
+ with AllowedPVS() as pvs:
+ pv = pvs[0]
+ self._test_prop(pv, 'pv_mda_count', long, False)
def testLvProperty(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
self._test_prop(lv, 'seg_count', long, False)
vg.close()
def testLvTags(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
self._testTags(lv)
vg.close()
def testLvActiveInactive(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
lv.deactivate()
self.assertTrue(lv.isActive() is False)
lv.activate()
@@ -264,7 +330,9 @@ class TestLvm(unittest.TestCase):
vg.close()
def testLvRename(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
current_name = lv.getName()
new_name = rs()
@@ -275,71 +343,96 @@ class TestLvm(unittest.TestCase):
def testLvSnapshot(self):
- #Cleanup existing if already present
- to_remove = ['thick_lv_snapshot', 'thin_lv_snapshot']
+ thin_lv = 'thin_lv'
+ thick_lv = 'thick_lv'
- for ss in to_remove:
- snap, vg = self._get_lv_test(None, ss)
- if snap:
- snap.remove()
- vg.close()
+ device_names = self._get_pv_device_names()
- thick_lv, vg = self._get_lv_test(None, 'thick_lv')
+ self._createThinLV(device_names[0:2], thin_lv)
+ self._createThickLV(device_names[2:4], thick_lv)
- self.assertEqual('thick_lv', thick_lv.getName())
-
- thick_lv.snapshot('thick_lv_snapshot', 1024*1024)
+ lv, vg = self._get_lv(None, thick_lv)
+ lv.snapshot('thick_snap_shot', 1024*1024)
vg.close()
- thin_lv, vg = self._get_lv_test(None, 'thin_lv')
- thin_lv.snapshot('thin_lv_snapshot')
+ thick_ss, vg = self._get_lv(None, 'thick_snap_shot')
+ self.assertTrue(thick_ss is not None)
+ vg.close()
+ thin_lv, vg = self._get_lv(None, thin_lv)
+ thin_lv.snapshot('thin_snap_shot')
vg.close()
- thin_ss, vg = self._get_lv_test(None, 'thin_lv_snapshot')
+ thin_ss, vg = self._get_lv(None, 'thin_snap_shot')
self.assertTrue(thin_ss is not None)
origin = thin_ss.getOrigin()
- self.assertTrue('thin_lv', origin)
+ self.assertTrue(thin_lv, origin)
vg.close()
def testLvSuspend(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
result = lv.isSuspended()
self.assertTrue(type(result) == bool)
vg.close()
def testLvSize(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
+
result = lv.getSize()
self.assertTrue(type(result) == int or type(result) == long)
vg.close()
def testLvResize(self):
- lv, vg = self._get_lv_test('V')
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
+
curr_size = lv.getSize()
lv.resize(curr_size+(1024*1024))
latest = lv.getSize()
self.assertTrue(curr_size != latest)
def testLvSeg(self):
- lv, vg = self._get_lv_test()
+ lv_name = 'lv_test'
+ self._createThinLV(self._get_pv_device_names(), lv_name)
+ lv, vg = self._get_lv(None, lv_name)
lv_segs = lv.listLVsegs()
#LVsegs returns a tuple, (value, bool settable)
-
#TODO: Test other properties of lv_seg
for i in lv_segs:
self._test_prop(i, 'seg_start_pe', long, False)
vg.close()
+ def testGetSetExtentSize(self):
+ thick_lv = 'get_set_prop'
+ device_names = self._get_pv_device_names()
+ self._createThickLV(device_names[0:2], thick_lv)
+ lv, vg = self._get_lv(None, thick_lv)
+
+ new_extent = 1024 * 1024 * 4
+
+ self.assertFalse(vg.getExtentSize() != new_extent,
+ "Cannot determine if it works if they are the same")
+
+ vg.setExtentSize(new_extent)
+ self.assertEqual(vg.getExtentSize(), new_extent)
+ vg.close()
+
def testVGsetGetProp(self):
- vg_name = 'full_vg'
- vg = lvm.vgOpen(vg_name, 'w')
+ thick_lv = 'get_set_prop'
+ device_names = self._get_pv_device_names()
+ self._createThickLV(device_names[0:2], thick_lv)
+ lv, vg = self._get_lv(None, thick_lv)
self.assertTrue(vg is not None)
if vg:
@@ -348,18 +441,23 @@ class TestLvm(unittest.TestCase):
vg.close()
def testVGremoveRestore(self):
-
#Store off the list of physical devices
- pe_devices = []
- vg = lvm.vgOpen('full_vg', 'w')
+ pv_devices = []
+
+ thick_lv = 'get_set_prop'
+ device_names = self._get_pv_device_names()
+ self._createThickLV(device_names[0:2], thick_lv)
+ lv, vg = self._get_lv(None, thick_lv)
+
+ vg_name = vg.getName()
pvs = vg.listPVs()
for p in pvs:
- pe_devices.append(p.getName())
+ pv_devices.append(p.getName())
vg.close()
- self._removeThick()
- self._createThick(pe_devices)
+ self._remove_VG(vg_name)
+ self._createThickLV(pv_devices, thick_lv)
def testVgNames(self):
vg = lvm.listVgNames()
@@ -370,12 +468,14 @@ class TestLvm(unittest.TestCase):
Try to create a lv with the same name expecting a failure
Note: This was causing a seg. fault previously
"""
- vgs = lvm.listVgNames()
+ thick_lv = 'dupe_name'
+ device_names = self._get_pv_device_names()
+ self._createThickLV(device_names[0:2], thick_lv)
+ lv, vg = self._get_lv(None, thick_lv)
- if len(vgs):
- vg_name = vgs[0]
- vg = lvm.vgOpen(vg_name, "w")
+ self.assertTrue(vg is not None)
+ if vg:
lvs = vg.listLVs()
if len(lvs):
@@ -383,14 +483,20 @@ class TestLvm(unittest.TestCase):
lv_name = lv.getName()
self.assertRaises(lvm.LibLVMError, vg.createLvLinear, lv_name,
lv.getSize())
+ vg.close()
def testVgUuids(self):
+
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
vgs_uuids = lvm.listVgUuids()
+ self.assertTrue(len(vgs_uuids) > 0)
self.assertTrue(isinstance(vgs_uuids, tuple))
vgs_uuids = list(vgs_uuids)
-
vgs_names = lvm.listVgNames()
for vg_name in vgs_names:
@@ -407,7 +513,13 @@ class TestLvm(unittest.TestCase):
self.assertTrue(len(vgs_uuids) == 0)
def testPvLookupFromVG(self):
- vg_names = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
+ vg_names = self._vg_names()
+
+ self.assertTrue(len(vg_names) > 0)
for vg_name in vg_names:
vg = lvm.vgOpen(vg_name, 'w')
@@ -455,7 +567,14 @@ class TestLvm(unittest.TestCase):
self.assertTrue(lvm.configFindBool("global/locking_type"))
def testVgFromPVLookups(self):
- vgname_list = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
+ vgname_list = self._vg_names()
+
+ self.assertTrue(len(vgname_list) > 0)
+
for vg_name in vgname_list:
vg = lvm.vgOpen(vg_name, 'r')
@@ -469,7 +588,13 @@ class TestLvm(unittest.TestCase):
vg.close()
def testVgGetName(self):
- vgname_list = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
+ vgname_list = self._vg_names()
+
+ self.assertTrue(len(vgname_list) > 0)
for vg_name in vgname_list:
vg = lvm.vgOpen(vg_name, 'r')
@@ -477,7 +602,13 @@ class TestLvm(unittest.TestCase):
vg.close()
def testVgGetUuid(self):
- vgname_list = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
+ vgname_list = self._vg_names()
+
+ self.assertTrue(len(vgname_list) > 0)
for vg_name in vgname_list:
vg = lvm.vgOpen(vg_name, 'r')
@@ -491,7 +622,13 @@ class TestLvm(unittest.TestCase):
"getPvCount", "getMaxPv", "getMaxLv"]
def testVgGetters(self):
- vg_name_list = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
+ self._createThinLV(device_names[0:2], 'thin')
+ self._createThickLV(device_names[2:4], 'thick')
+
+ vg_name_list = self._vg_names()
+
+ self.assertTrue(len(vg_name_list) > 0)
for vg_name in vg_name_list:
vg = lvm.vgOpen(vg_name, 'r')
@@ -541,9 +678,17 @@ class TestLvm(unittest.TestCase):
self.assertTrue(e in current_tags)
def testVgTags(self):
- vg_name_list = lvm.listVgNames()
+ device_names = self._get_pv_device_names()
- for vg_name in vg_name_list:
+ i = 0
+ for d in device_names:
+ if i % 2 == 0:
+ self._createThinLV([d], "thin_lv%d" % i)
+ else:
+ self._createThickLV([d], "thick_lv%d" % i)
+ i += 1
+
+ for vg_name in self._vg_names():
vg = lvm.vgOpen(vg_name, 'w')
self._testTags(vg)
vg.close()
10 years, 9 months
master - python unit test: White space/pep8 cleanup
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df6f0f71b10748...
Commit: df6f0f71b10748fb809fa4d04de7541773a83ac3
Parent: 46a1202a610e717f5c59db54417eeee022b21e83
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Thu Jul 25 18:24:52 2013 -0400
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Jul 26 10:24:08 2013 -0500
python unit test: White space/pep8 cleanup
pep8 compliant, except for using tabs instead of
spaces.
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
test/api/python_lvm_unit.py | 52 +++++++++++++++++++++---------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/test/api/python_lvm_unit.py b/test/api/python_lvm_unit.py
index 7c1fdc3..cc18dce 100755
--- a/test/api/python_lvm_unit.py
+++ b/test/api/python_lvm_unit.py
@@ -19,6 +19,7 @@ import lvm
# Set of basic unit tests for the python bindings.
+
def rs(l=10):
"""
Generate a random string
@@ -29,7 +30,6 @@ def rs(l=10):
class TestLvm(unittest.TestCase):
(FULL_PV, THIN_PV_A, THIN_PV_B, RESIZE_PV) = (0, 1, 2, 3)
-
def _get_pv_devices(self):
rc = []
with lvm.listPvs() as pvs:
@@ -46,9 +46,9 @@ class TestLvm(unittest.TestCase):
for d in device_list:
vg.extend(d)
- #new_extent = 1024 * 1024 * 2
- #vg.setExtentSize(new_extent)
- #self.assertEqual(vg.getExtentSize(), new_extent)
+ new_extent = 1024 * 1024 * 2
+ vg.setExtentSize(new_extent)
+ self.assertEqual(vg.getExtentSize(), new_extent)
vg.createLvLinear('thick_lv', vg.getSize()/2)
vg.close()
@@ -98,7 +98,7 @@ class TestLvm(unittest.TestCase):
vg.extend(device_list[TestLvm.THIN_PV_A])
vg.extend(device_list[TestLvm.THIN_PV_B])
vg.createLvThinpool('thin_pool', vg.getSize()/2, 0, 0,
- lvm.THIN_DISCARDS_PASSDOWN, 1)
+ lvm.THIN_DISCARDS_PASSDOWN, 1)
vg.createLvThin('thin_pool', 'thin_lv', vg.getSize()/3)
vg.close()
vg = None
@@ -207,13 +207,17 @@ class TestLvm(unittest.TestCase):
self.assertEqual(type(pv.getUuid()), str)
self.assertTrue(len(pv.getUuid()) > 0)
- self.assertTrue(type(pv.getMdaCount()) == int or type(pv.getMdaCount()) == long )
+ self.assertTrue(type(pv.getMdaCount()) == int or
+ type(pv.getMdaCount()) == long)
- self.assertTrue(type(pv.getSize()) == int or type(pv.getSize()) == long)
+ self.assertTrue(type(pv.getSize()) == int or
+ type(pv.getSize()) == long)
- self.assertTrue(type(pv.getDevSize()) == int or type(pv.getSize()) == long)
+ self.assertTrue(type(pv.getDevSize()) == int or
+ type(pv.getSize()) == long)
- self.assertTrue(type(pv.getFree()) == int or type(pv.getFree()) == long)
+ self.assertTrue(type(pv.getFree()) == int or
+ type(pv.getFree()) == long)
vg.close()
@@ -254,9 +258,9 @@ class TestLvm(unittest.TestCase):
def testLvActiveInactive(self):
lv, vg = self._get_lv_test()
lv.deactivate()
- self.assertTrue(lv.isActive() == False)
+ self.assertTrue(lv.isActive() is False)
lv.activate()
- self.assertTrue(lv.isActive() == True)
+ self.assertTrue(lv.isActive() is True)
vg.close()
def testLvRename(self):
@@ -272,7 +276,7 @@ class TestLvm(unittest.TestCase):
def testLvSnapshot(self):
#Cleanup existing if already present
- to_remove = [ 'thick_lv_snapshot', 'thin_lv_snapshot']
+ to_remove = ['thick_lv_snapshot', 'thin_lv_snapshot']
for ss in to_remove:
snap, vg = self._get_lv_test(None, ss)
@@ -280,7 +284,6 @@ class TestLvm(unittest.TestCase):
snap.remove()
vg.close()
-
thick_lv, vg = self._get_lv_test(None, 'thick_lv')
self.assertEqual('thick_lv', thick_lv.getName())
@@ -301,7 +304,6 @@ class TestLvm(unittest.TestCase):
vg.close()
-
def testLvSuspend(self):
lv, vg = self._get_lv_test()
@@ -312,7 +314,7 @@ class TestLvm(unittest.TestCase):
def testLvSize(self):
lv, vg = self._get_lv_test()
result = lv.getSize()
- self.assertTrue(type(result) == int or type(result)== long)
+ self.assertTrue(type(result) == int or type(result) == long)
vg.close()
def testLvResize(self):
@@ -379,9 +381,8 @@ class TestLvm(unittest.TestCase):
if len(lvs):
lv = lvs[0]
lv_name = lv.getName()
- self.assertRaises(lvm.LibLVMError,
- vg.createLvLinear, lv_name,
- lv.getSize())
+ self.assertRaises(lvm.LibLVMError, vg.createLvLinear, lv_name,
+ lv.getSize())
def testVgUuids(self):
vgs_uuids = lvm.listVgUuids()
@@ -419,10 +420,10 @@ class TestLvm(unittest.TestCase):
pv_name_lookup = vg.pvFromName(name)
pv_uuid_lookup = vg.pvFromUuid(uuid)
- self.assertTrue(pv_name_lookup.getName() == \
- pv_uuid_lookup.getName())
- self.assertTrue(pv_name_lookup.getUuid() == \
- pv_uuid_lookup.getUuid())
+ self.assertTrue(pv_name_lookup.getName() ==
+ pv_uuid_lookup.getName())
+ self.assertTrue(pv_name_lookup.getUuid() ==
+ pv_uuid_lookup.getUuid())
self.assertTrue(name == pv_name_lookup.getName())
self.assertTrue(uuid == pv_uuid_lookup.getUuid())
@@ -434,7 +435,6 @@ class TestLvm(unittest.TestCase):
pvs = None
vg.close()
-
def testPercentToFloat(self):
self.assertEqual(lvm.percentToFloat(0), 0.0)
self.assertEqual(lvm.percentToFloat(1000000), 1.0)
@@ -486,7 +486,6 @@ class TestLvm(unittest.TestCase):
self.assertTrue(len(uuid) > 0)
vg.close()
-
RETURN_NUMERIC = ["getSeqno", "getSize", "getFreeSize", "getFreeSize",
"getExtentSize", "getExtentCount", "getFreeExtentCount",
"getPvCount", "getMaxPv", "getMaxLv"]
@@ -504,7 +503,7 @@ class TestLvm(unittest.TestCase):
for method_name in TestLvm.RETURN_NUMERIC:
method = getattr(vg, method_name)
result = method()
- self.assertTrue(type(result) == int or type(result)== long)
+ self.assertTrue(type(result) == int or type(result) == long)
vg.close()
@@ -526,7 +525,8 @@ class TestLvm(unittest.TestCase):
num_remove = len(created_tags)
for i in range(num_remove):
- tag_to_remove = created_tags[random.randint(0, len(created_tags) - 1)]
+ tag_to_remove = created_tags[
+ random.randint(0, len(created_tags) - 1)]
created_tags.remove(tag_to_remove)
10 years, 9 months
master - python-lvm: Correct parsing arguments for integers
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=46a1202a610e71...
Commit: 46a1202a610e717f5c59db54417eeee022b21e83
Parent: ecc9f74988f7e18a24741e3bf55753383cc904b6
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Thu Jul 25 15:54:57 2013 -0400
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Fri Jul 26 10:24:01 2013 -0500
python-lvm: Correct parsing arguments for integers
There were a few places where the code was incorrectly
using parse arguments for the supplied variable type &
size. Changing the variables to be declared exactly
like python is expecting so if we build on an arch
where the size of type is different than typically
expected we will continue to match. In addition the
parse character needed to be corrected in a few spots
too.
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
python/liblvm.c | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/python/liblvm.c b/python/liblvm.c
index ab32199..a9de817 100644
--- a/python/liblvm.c
+++ b/python/liblvm.c
@@ -295,11 +295,11 @@ static PyObject *_liblvm_lvm_pv_remove(PyObject *self, PyObject *arg)
static PyObject *_liblvm_lvm_pv_create(PyObject *self, PyObject *arg)
{
const char *pv_name;
- uint64_t size;
+ unsigned long long size;
LVM_VALID();
- if (!PyArg_ParseTuple(arg, "sl", &pv_name, &size))
+ if (!PyArg_ParseTuple(arg, "sK", &pv_name, &size))
return NULL;
if (lvm_pv_create(_libh, pv_name, size) == -1) {
@@ -905,11 +905,11 @@ static PyObject *_liblvm_lvm_vg_get_max_lv(vgobject *self)
static PyObject *_liblvm_lvm_vg_set_extent_size(vgobject *self, PyObject *args)
{
- uint32_t new_size;
+ unsigned int new_size;
VG_VALID(self);
- if (!PyArg_ParseTuple(args, "l", &new_size))
+ if (!PyArg_ParseTuple(args, "I", &new_size))
return NULL;
if (lvm_vg_set_extent_size(self->vg, new_size) == -1) {
@@ -985,12 +985,12 @@ static PyObject *_liblvm_lvm_vg_get_tags(vgobject *self)
static PyObject *_liblvm_lvm_vg_create_lv_linear(vgobject *self, PyObject *args)
{
const char *vgname;
- uint64_t size;
+ unsigned long long size;
lvobject *lvobj;
VG_VALID(self);
- if (!PyArg_ParseTuple(args, "sl", &vgname, &size))
+ if (!PyArg_ParseTuple(args, "sK", &vgname, &size))
return NULL;
if (!(lvobj = PyObject_New(lvobject, &_LibLVMlvType)))
@@ -1013,10 +1013,10 @@ static PyObject *_liblvm_lvm_vg_create_lv_linear(vgobject *self, PyObject *args)
static PyObject *_liblvm_lvm_vg_create_lv_thinpool(vgobject *self, PyObject *args)
{
+ unsigned long long size = 0;
+ unsigned long long meta_size = 0;
const char *pool_name;
- uint64_t size = 0;
- uint32_t chunk_size = 0;
- uint64_t meta_size = 0;
+ unsigned long chunk_size = 0;
int skip_zero = 0;
lvm_thin_discards_t discard = LVM_THIN_DISCARDS_PASSDOWN;
lvobject *lvobj;
@@ -1074,7 +1074,7 @@ static PyObject *_liblvm_lvm_vg_create_lv_thin(vgobject *self, PyObject *args)
{
const char *pool_name;
const char *lv_name;
- uint64_t size = 0;
+ unsigned long long size = 0;
lvobject *lvobj;
lv_create_params_t lvp = NULL;
@@ -1455,11 +1455,11 @@ static PyObject *_liblvm_lvm_lv_rename(lvobject *self, PyObject *args)
static PyObject *_liblvm_lvm_lv_resize(lvobject *self, PyObject *args)
{
- uint64_t new_size;
+ unsigned long long new_size;
LV_VALID(self);
- if (!PyArg_ParseTuple(args, "l", &new_size))
+ if (!PyArg_ParseTuple(args, "K", &new_size))
return NULL;
if (lvm_lv_resize(self->lv, new_size) == -1) {
@@ -1509,7 +1509,7 @@ static PyObject *_liblvm_lvm_lv_list_lvsegs(lvobject *self)
static PyObject *_liblvm_lvm_lv_snapshot(lvobject *self, PyObject *args)
{
const char *snap_name;
- uint64_t size = 0;
+ unsigned long long size = 0;
lvobject *lvobj;
lv_create_params_t lvp = NULL;
@@ -1616,11 +1616,11 @@ static PyObject *_liblvm_lvm_pv_get_free(pvobject *self)
static PyObject *_liblvm_lvm_pv_resize(pvobject *self, PyObject *args)
{
- uint64_t new_size;
+ unsigned long long new_size;
PV_VALID(self);
- if (!PyArg_ParseTuple(args, "l", &new_size))
+ if (!PyArg_ParseTuple(args, "K", &new_size))
return NULL;
if (lvm_pv_resize(self->pv, new_size) == -1) {
10 years, 9 months
master - filters: fix segfault on incorrect global_filter
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ecc9f74988f7e1...
Commit: ecc9f74988f7e18a24741e3bf55753383cc904b6
Parent: 06dce7d5398cf44a4502ff730987e99bc8b3b78a
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jul 26 12:47:28 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jul 26 13:04:53 2013 +0200
filters: fix segfault on incorrect global_filter
When using a global_filter and if this filter is incorrectly
specified, we ended up with a segfault:
raw/~ $ pvs
Invalid filter pattern "r|/dev/sda".
Segmentation fault (core dumped)
In the example above a closing '|' character is missing at the end
of the regex. The segfault itself was caused by trying to destroy
the same filter twice in _init_filters fn within the error path
(the "bad" goto target):
bad:
if (f3)
f3->destroy(f3);
if (f4)
f4->destroy(f4);
Where f3 is the composite filter (sysfs + regex + type + md + mpath filter)
and f4 is the persistent filter which encompasses this composite filter
within persistent filter's 'real' field in 'struct pfilter'.
So in the end, we need to destroy the persistent filter only as
this will also destroy any 'real' filter attached to it.
---
WHATS_NEW | 1 +
lib/commands/toolcontext.c | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3544f87..3318454 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.100 -
================================
+ Fix segfault if devices/global_filter is not specified correctly.
Version 2.02.99 - 24th July 2013
================================
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index b284ce5..48fc489 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -940,8 +940,7 @@ static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache
if (!(f4 = persistent_filter_create(cmd->dev_types, f3, dev_cache))) {
log_verbose("Failed to create persistent device filter.");
- f3->destroy(f3);
- return_0;
+ goto bad;
}
/* Should we ever dump persistent filter state? */
@@ -977,10 +976,10 @@ static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache
return 1;
bad:
- if (f3)
- f3->destroy(f3);
if (f4)
f4->destroy(f4);
+ else if (f3)
+ f3->destroy(f3);
if (toplevel_components[0])
toplevel_components[0]->destroy(toplevel_components[0]);
return 0;
10 years, 9 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=06dce7d5398cf4...
Commit: 06dce7d5398cf44a4502ff730987e99bc8b3b78a
Parent: 76e617b1587b68b78f7ae5659e2293edcda630c3
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Thu Jul 25 00:38:53 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Thu Jul 25 00:38:53 2013 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index a3db87f..1716ee6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.99(2)-git (2013-07-24)
+2.02.100(2)-git (2013-07-24)
diff --git a/VERSION_DM b/VERSION_DM
index 748468a..067a488 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.78-git (2013-07-24)
+1.02.79-git (2013-07-24)
diff --git a/WHATS_NEW b/WHATS_NEW
index 039ddec..3544f87 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.100 -
+================================
+
Version 2.02.99 - 24th July 2013
================================
Do not zero init 4KB of thin snapshot for non-zeroing thin pool (2.02.94).
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 3009427..cd77bc6 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.79 -
+================================
+
Version 1.02.78 - 24th July 2013
================================
Process thin messages once to active thin pool target for dm_tree.
10 years, 9 months
master - release 2.02.99
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=76e617b1587b68...
Commit: 76e617b1587b68b78f7ae5659e2293edcda630c3
Parent: 929d5f3563d0ca0acbbb220e8c212f9441260d68
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 24 23:59:03 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 24 23:59:03 2013 +0100
release 2.02.99
363 files changed, 19863 insertions(+), 9055 deletions(-)
This is a very large release - so expect bugs!
Please treat this release like a release candidate.
Changes to the external interfaces since 2.02.98 are not yet frozen.
Updated releases will follow quickly (days not weeks) as any problems
are handled.
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 4 ++--
WHATS_NEW_DM | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index f8dcbdc..a3db87f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.99(2)-git (2012-10-22)
+2.02.99(2)-git (2013-07-24)
diff --git a/VERSION_DM b/VERSION_DM
index 75d1302..748468a 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.78-git (2012-10-22)
+1.02.78-git (2013-07-24)
diff --git a/WHATS_NEW b/WHATS_NEW
index 587b53d..039ddec 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,5 @@
-Version 2.02.99 -
-===================================
+Version 2.02.99 - 24th July 2013
+================================
Do not zero init 4KB of thin snapshot for non-zeroing thin pool (2.02.94).
Issue an error msg if lvconvert --type used incorrectly with other options.
Use LOG_DEBUG/ERR msg severity instead default for lvm2-activation-generator.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index b269f55..3009427 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,5 @@
-Version 1.02.78 -
-===================================
+Version 1.02.78 - 24th July 2013
+================================
Process thin messages once to active thin pool target for dm_tree.
Optimize out setting the same value or read_ahead.
Add DM_ARRAY_SIZE public macro.
10 years, 9 months
master - python-lvm: Change exception back to LibLVMerror
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=929d5f3563d0ca...
Commit: 929d5f3563d0ca0acbbb220e8c212f9441260d68
Parent: d13e87b9efb07f6e40d9fb44b72387231d493fa2
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Wed Jul 24 18:29:41 2013 -0400
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Jul 24 17:55:12 2013 -0500
python-lvm: Change exception back to LibLVMerror
This is an API exposed name and shouldn't be changed
to _LibLVMError.
Signed-off-by: Tony Asleson <tasleson(a)redhat.com>
---
python/liblvm.c | 2 +-
test/api/python_lvm_unit.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/python/liblvm.c b/python/liblvm.c
index d6a7b8d..ab32199 100644
--- a/python/liblvm.c
+++ b/python/liblvm.c
@@ -1957,7 +1957,7 @@ PyMODINIT_FUNC initlvm(void)
Py_INCREF(_LibLVMError);
Py_INCREF(_LibLVMError);
PyModule_AddObject(m, "error", _LibLVMError);
- PyModule_AddObject(m, "_LibLVMError", _LibLVMError);
+ PyModule_AddObject(m, "LibLVMError", _LibLVMError);
}
Py_AtExit(_liblvm_cleanup);
diff --git a/test/api/python_lvm_unit.py b/test/api/python_lvm_unit.py
index 6491413..7c1fdc3 100755
--- a/test/api/python_lvm_unit.py
+++ b/test/api/python_lvm_unit.py
@@ -46,9 +46,9 @@ class TestLvm(unittest.TestCase):
for d in device_list:
vg.extend(d)
- new_extent = 1024 * 1024 * 2
- vg.setExtentSize(new_extent)
- self.assertEqual(vg.getExtentSize(), new_extent)
+ #new_extent = 1024 * 1024 * 2
+ #vg.setExtentSize(new_extent)
+ #self.assertEqual(vg.getExtentSize(), new_extent)
vg.createLvLinear('thick_lv', vg.getSize()/2)
vg.close()
10 years, 9 months
master - cleanup: comments and a message
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d13e87b9efb07f...
Commit: d13e87b9efb07f6e40d9fb44b72387231d493fa2
Parent: 97df05ce107ae2bed9ef02cfcdcdde39bd2100d4
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 24 22:10:37 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 24 22:10:37 2013 +0100
cleanup: comments and a message
---
WHATS_NEW | 15 ++++++++-------
lib/config/config.h | 2 +-
make.tmpl.in | 1 +
tools/vgimport.c | 3 +--
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fd44fb1..587b53d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -5,7 +5,7 @@ Version 2.02.99 -
Use LOG_DEBUG/ERR msg severity instead default for lvm2-activation-generator.
Support ARG_GROUPABLE with merge_synonym (for --raidwritemostly).
Fix segfault when reporting raid_syncaction for older kernels.
- Add LV reporting fields raid_mismatch_count, raid_sync_action, raid_write_behind.
+ Add LV report fields: raid_mismatch_count/raid_sync_action/raid_write_behind.
Add LV reporting fields raid_min_recovery_rate, raid_max_recovery_rate.
Add sync_percent as alias for copy_percent LV reporting field.
Add lv_ prefix to modules reporting field.
@@ -63,6 +63,8 @@ Version 2.02.99 -
Report lvs volume type 'o' also for external origin volumes.
Report lvs target type 't' only for thin pools and thin volumes.
Fix test for active snapshot in cluster before resizing it.
+ Allow local activation to receive a locally-supplied LV struct.
+ Add vg->vg_ondisk / lv_ondisk() holding committed metadata.
Report backtrace from dump filter error path.
Do not use persistent filter with lvmetad.
Composable persistent filter functionality for global filter.
@@ -99,7 +101,6 @@ Version 2.02.99 -
Add lvcreate/lvchange --[raid]{min|max}recoveryrate for raid LVs.
Add lvchange --[raid]writemostly/writebehind support for RAID1
Add lv_change_activate() for common activation code in vg/lvchange.
- Revert change that allowed identical table reload for RAID.
Add lvchange --[raid]syncaction for scrubbing of RAID LVs.
Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
Add external origin support for lvcreate.
@@ -114,19 +115,19 @@ Version 2.02.99 -
Add --type {current|default|missing|new} and --atversion to lvm dumpconfig.
Support automatic config validation and add 'config' section to lvm.conf.
Add pvs -o pv_ba_start,pv_ba_size to report bootloader area start and size.
- Add --bootloaderareasize to pvcreate and vgconvert to create a bootloader area.
+ Add --bootloaderareasize to pvcreate and vgconvert to create bootloader area.
Add PV header extension: extension version, flags and bootloader areas.
Initial support for lvconvert of thin external origin.
Add _lv_remove_segs_using_this_lv() for removal of dependent lvs.
Improve activation code for better support of stacked devices.
Add _add_layer_target_to_dtree() for adding linear layer into dtree.
Extend _cached_info() to accept layer string.
- Allow identical table reload for RAID to restore transiently failed PVs.
- vgimport '--force' now allows users to import VGs with missing PVs.
+ vgimport '--force' now allows import of VGs with missing PVs.
Fix PV alignment to incorporate alignment offset if the PV has zero MDAs.
- Allow remove/replace of RAID sub-LVs that are composed of error targets.
+ Add global/raid10_segtype_default to lvm.conf.
+ Allow removal or replacement of RAID LV components that are error segments.
Make 'vgreduce --removemissing' able to handle RAID LVs with missing PVs.
- Rename lvm.conf setting 'mirror_region_size' to 'raid_region_size'.
+ Accept activation/raid_region_size in preference to mirror_region_size config.
Fix pvs -o pv_free reporting for PVs with zero PE count.
Fix missing cleanup of flags when the LV is detached from pool.
Fix check for some forbidden discards conversion of thin pools.
diff --git a/lib/config/config.h b/lib/config/config.h
index 263da4f..f57757b 100644
--- a/lib/config/config.h
+++ b/lib/config/config.h
@@ -20,7 +20,7 @@
#include "defaults.h"
/* 16 bits: 3 bits for major, 4 bits for minor, 9 bits for patchlevel */
-/* Max LVM version supported: 7.15.511. Just extend bits if ever needed. */
+/* FIXME Max LVM version supported: 7.15.511. Extend bits when needed. */
#define vsn(major, minor, patchlevel) (major << 13 | minor << 9 | patchlevel)
struct device;
diff --git a/make.tmpl.in b/make.tmpl.in
index e2c4441..6992255 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -34,6 +34,7 @@ LIBS = @LIBS@
# Extra libraries always linked with static binaries
STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS)
DEFS += @DEFS@
+# FIXME set this only where it's needed, not globally?
CFLAGS += @CFLAGS@ @UDEV_CFLAGS@
CLDFLAGS += @CLDFLAGS@
ELDFLAGS += @ELDFLAGS@
diff --git a/tools/vgimport.c b/tools/vgimport.c
index 20cae6c..3a0798a 100644
--- a/tools/vgimport.c
+++ b/tools/vgimport.c
@@ -80,8 +80,7 @@ int vgimport(struct cmd_context *cmd, int argc, char **argv)
* where the user simply forgot to move one or more disks in
* the VG before running 'vgimport'.
*/
- log_print("'--force' supplied. Volume groups with missing PVs"
- " will be imported.");
+ log_warn("WARNING: Volume groups with missing PVs will be imported with --force.");
cmd->handles_missing_pvs = 1;
}
10 years, 9 months
master - python: Introduce pyexecdir
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=97df05ce107ae2...
Commit: 97df05ce107ae2bed9ef02cfcdcdde39bd2100d4
Parent: 462df8d89df2b87bbdb11c31b0b94523dea7aa28
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 24 22:07:10 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 24 22:07:10 2013 +0100
python: Introduce pyexecdir
Use pyexecdir for $DESTDIR + $prefix
---
make.tmpl.in | 1 +
python/Makefile.in | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/make.tmpl.in b/make.tmpl.in
index ae62182..e2c4441 100644
--- a/make.tmpl.in
+++ b/make.tmpl.in
@@ -73,6 +73,7 @@ systemd_unit_dir = $(DESTDIR)@systemdsystemunitdir@
systemd_generator_dir = $(DESTDIR)@systemdutildir@/system-generators
tmpfiles_dir = $(DESTDIR)@tmpfilesdir@
ocf_scriptdir = $(DESTDIR)@OCFDIR@
+pyexecdir = $(DESTDIR)$(prefix)
USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
$(AWK) -f $(top_srcdir)/scripts/relpath.awk)
diff --git a/python/Makefile.in b/python/Makefile.in
index c9572d8..1aaec7e 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -27,7 +27,7 @@ liblvm_python.c:
include $(top_builddir)/make.tmpl
install_python_bindings: python_bindings
- $(PYTHON) setup.py install --skip-build --prefix $(prefix)
+ $(PYTHON) setup.py install --skip-build --prefix $(pyexecdir)
install_lvm2: install_python_bindings
10 years, 9 months
master - python: fix Makefile installation path
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=462df8d89df2b8...
Commit: 462df8d89df2b87bbdb11c31b0b94523dea7aa28
Parent: f5a205668b9965a7a2471d9e7cbcd3db49a495c7
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 24 21:52:39 2013 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 24 21:52:39 2013 +0100
python: fix Makefile installation path
Use --prefix rather than --root.
(Needs more thorough investigation, but this seems to avoid /usr/usr
paths.)
---
python/Makefile.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/python/Makefile.in b/python/Makefile.in
index fd529b8..c9572d8 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -27,7 +27,7 @@ liblvm_python.c:
include $(top_builddir)/make.tmpl
install_python_bindings: python_bindings
- $(PYTHON) setup.py install --skip-build --root $(DESTDIR)$(prefix)
+ $(PYTHON) setup.py install --skip-build --prefix $(prefix)
install_lvm2: install_python_bindings
10 years, 9 months