Change in vdsm[ovirt-3.3]: Make hsm.getVolumesList() pool independent.
fsimonce at redhat.com
fsimonce at redhat.com
Tue Oct 15 12:01:54 UTC 2013
Hello Ayal Baron, Eduardo,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20190
to review the following change.
Change subject: Make hsm.getVolumesList() pool independent.
......................................................................
Make hsm.getVolumesList() pool independent.
Related to BZ#960952.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1019273
Change-Id: Ib810ca24818fa4a77905032694a05c0d86ef75e2
Signed-off-by: Eduardo <ewarszaw at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/15766
Reviewed-by: Ayal Baron <abaron at redhat.com>
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/20190/1
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 061182d..ace6634 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3281,8 +3281,7 @@
"""
Gets a list of all volumes.
- :param spUUID: The UUID of the storage pool that manages the storage
- domain you want to query.
+ :param spUUID: Unused.
:type spUUID: UUID
:param sdUUID: The UUID of the storage domain you want to query.
:type sdUUID: UUID
@@ -3293,18 +3292,12 @@
"""
vars.task.getSharedLock(STORAGE, sdUUID)
dom = sdCache.produce(sdUUID=sdUUID)
+ vols = dom.getAllVolumes()
if imgUUID == volume.BLANK_UUID:
- images = list(dom.getAllImages())
+ volUUIDs = vols.keys()
else:
- images = [imgUUID]
-
- uuidlist = []
- repoPath = os.path.join(self.storage_repository, spUUID)
- for img in images:
- uuidlist += (dom.getVolumeClass().
- getImageVolumes(repoPath, sdUUID, img))
- self.log.info("List of volumes is %s", uuidlist)
- return dict(uuidlist=uuidlist)
+ volUUIDs = [k for k, v in vols.iteritems() if imgUUID in v.imgs]
+ return dict(uuidlist=volUUIDs)
@public
def getImagesList(self, sdUUID, options=None):
--
To view, visit http://gerrit.ovirt.org/20190
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib810ca24818fa4a77905032694a05c0d86ef75e2
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
More information about the vdsm-patches
mailing list