Eduardo has uploaded a new change for review.
Change subject: Avoid redundant volume produces. ......................................................................
Avoid redundant volume produces.
Add sd.getVolumePath() returns the volume path without produce it.
Deprecating hsm.getVolumePath() and hsm.prepareVolume(). When removed, remove API.prepare(), BindingXMLRPC.volumePrepare(), API.getPath, BindingXMLRPC.volumeGetPath(), etc.
Change-Id: I3ad53a7e8a66d7f9bdd62048f2bf1f722a490c5c Signed-off-by: Eduardo ewarszaw@redhat.com --- M vdsm/storage/fileSD.py M vdsm/storage/hsm.py M vdsm/storage/sd.py 3 files changed, 11 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/17991/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index 9d1493d..8cbea23 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -302,8 +302,7 @@ Return the volume lease (leasePath, leaseOffset) """ if self.hasVolumeLeases(): - vol = self.produceVolume(imgUUID, volUUID) - volumePath = vol.getVolumePath() + volumePath = self.getVolumePath(imgUUID, volUUID) leasePath = volumePath + fileVolume.LEASE_FILEEXT return leasePath, fileVolume.LEASE_FILEOFFSET return None, None @@ -426,8 +425,9 @@ # NFS volumes. In theory it is necessary to fix the permission # of the leaf only but to not introduce an additional requirement # (ordered volUUIDs) we fix them all. - for vol in [self.produceVolume(imgUUID, x) for x in volUUIDs]: - self.oop.fileUtils.copyUserModeToGroup(vol.getVolumePath()) + for volUUID in volUUIDs: + volPath = self.getVolumePath(imgUUID, volUUID) + self.oop.fileUtils.copyUserModeToGroup(volPath)
@classmethod def format(cls, sdUUID): diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py index c754ee8..3545677 100644 --- a/vdsm/storage/hsm.py +++ b/vdsm/storage/hsm.py @@ -3076,6 +3076,7 @@ volUUID=volUUID).getInfo() return dict(info=info)
+ @deprecated @public def getVolumePath(self, sdUUID, spUUID, imgUUID, volUUID, options=None): """ @@ -3100,8 +3101,7 @@ """ vars.task.getSharedLock(STORAGE, sdUUID) path = sdCache.produce( - sdUUID=sdUUID).produceVolume(imgUUID=imgUUID, - volUUID=volUUID).getVolumePath() + sdUUID=sdUUID).getVolumePath(imgUUID, volUUID) return dict(path=path)
@public @@ -3127,6 +3127,7 @@ if fails: self.log.error("Failed to remove the following rules: %s", fails)
+ @deprecated @public def prepareVolume(self, sdUUID, spUUID, imgUUID, volUUID, rw=True, options=None): diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py index 36c4877..dde7832 100644 --- a/vdsm/storage/sd.py +++ b/vdsm/storage/sd.py @@ -640,6 +640,10 @@ # If it has a repo we don't have multiple domains. Assume single pool return os.path.join(self.storage_repository, self.getPools()[0])
+ def getVolumePath(self, imgUUID, volUUID): + return os.path.join(self.mountpoint, self.sdUUID, 'images', imgUUID, + volUUID) + def getIsoDomainImagesDir(self): """ Get 'images' directory from Iso domain
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/3880/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/3797/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/2991/ : SUCCESS
Ayal Baron has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1: Code-Review+1
Itamar Heim has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1:
ping
Eduardo has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1:
This change is should relevant. Should be rebased, verified by QE and merged.
Federico Simoncelli has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1:
(1 comment)
http://gerrit.ovirt.org/#/c/17991/1/vdsm/storage/sd.py File vdsm/storage/sd.py:
Line 640: # If it has a repo we don't have multiple domains. Assume single pool Line 641: return os.path.join(self.storage_repository, self.getPools()[0]) Line 642: Line 643: def getVolumePath(self, imgUUID, volUUID): Line 644: return os.path.join(self.mountpoint, self.sdUUID, 'images', imgUUID, Use DOMAIN_IMAGES instead of 'images'. Also this getVolumePath looks different from the previous vol.getVolumePath since it reaches the volume through the mountpoint instead that through the storage pool directory. Line 645: volUUID) Line 646: Line 647: def getIsoDomainImagesDir(self): Line 648: """
Itamar Heim has posted comments on this change.
Change subject: Avoid redundant volume produces. ......................................................................
Patch Set 1:
ping
Itamar Heim has abandoned this change.
Change subject: Avoid redundant volume produces. ......................................................................
Abandoned
no activity. please restore if/when still relevant.
vdsm-patches@lists.fedorahosted.org