Hello Lee Yarwood, Federico Simoncelli, Allon Mureinik,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/21500
to review the following change.
Change subject: lvm: Allow multiple LVs to be refreshed at once.
......................................................................
lvm: Allow multiple LVs to be refreshed at once.
This change refactors the refreshLV method to allow multiple
volumes to be refreshed at once as possible with the activate
and deactive methods.
This is patch 1 in a series of 3 that aim to resolve BZ#1009812.
This patch is required by the changes listed below :
lvm: Make the isLVActive() method public.
http://gerrit.ovirt.org/#/c/21386/
blockSD: Ensure active volumes are refreshed before use.
http://gerrit.ovirt.org/#/c/21387
bug-url: https://bugzilla.redhat.com/1009812
Change-Id: I1ecc64b8ca0133b030ba5bfa37f1a2c55067dd5d
Signed-off-by: Lee Yarwood <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/19871
Reviewed-by: Nir Soffer <[email protected]>
Reviewed-by: Allon Mureinik <[email protected]>
Tested-by: Nir Soffer <[email protected]>
Reviewed-by: Federico Simoncelli <[email protected]>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/lvm.py
2 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/21500/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index badf2c1..958a04d 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -95,7 +95,7 @@
volume.Volume.validate(self)
def refreshVolume(self):
- lvm.refreshLV(self.sdUUID, self.volUUID)
+ lvm.refreshLVs(self.sdUUID, (self.volUUID,))
@classmethod
def getVSize(cls, sdobj, imgUUID, volUUID, bs=BLOCK_SIZE):
diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py
index 7f87362..b195343 100644
--- a/vdsm/storage/lvm.py
+++ b/vdsm/storage/lvm.py
@@ -1150,11 +1150,12 @@
_lvminfo._reloadlvs(vg, newlv)
-def refreshLV(vgName, lvName):
- # If the logical volume is active, reload its metadata.
- cmd = ['lvchange', '--refresh', "%s/%s" % (vgName, lvName)]
+def refreshLVs(vgName, lvNames):
+ # If the logical volumes are active, reload their metadata.
+ cmd = ['lvchange', '--refresh']
+ cmd.extend("%s/%s" % (vgName, lv) for lv in lvNames)
rc, out, err = _lvminfo.cmd(cmd, _lvminfo._getVGDevs((vgName, )))
- _lvminfo._invalidatelvs(vgName, lvName)
+ _lvminfo._invalidatelvs(vgName, lvNames)
if rc != 0:
raise se.LogicalVolumeRefreshError("%s failed" % list2cmdline(cmd))
--
To view, visit http://gerrit.ovirt.org/21500
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ecc64b8ca0133b030ba5bfa37f1a2c55067dd5d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Lee Yarwood <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches