Nir Soffer has uploaded a new change for review.

Change subject: volume: Use StorageDomainManitest when possible
......................................................................

volume: Use StorageDomainManitest when possible

New code should use the StorageDomainManifest classes instead of the
StorageDomain classes when possible. This change use the new
sdCache.produce_manitest() in few places.

Change-Id: If64a3ff30124b6c3bee86101510379ac72678ac6
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M vdsm/storage/fileVolume.py
M vdsm/storage/volume.py
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/60347/1

diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 93e6e98..302495f 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -305,7 +305,7 @@
         self.oop.utils.forceLink(self._getMetaVolumePath(), dstMetaPath)
 
         # Link the lease file if the domain uses sanlock
-        if sdCache.produce(self.sdUUID).hasVolumeLeases():
+        if sdCache.produce_manifest(self.sdUUID).hasVolumeLeases():
             self._shareLease(dstImgPath)
 
     @classmethod
@@ -321,7 +321,7 @@
         volList = []
         for i in files:
             volid = os.path.splitext(os.path.basename(i))[0]
-            if (sdCache.produce(sdUUID).
+            if (sdCache.produce_manifest(sdUUID).
                     produceVolume(imgUUID, volid).
                     getImage() == imgUUID):
                 volList.append(volid)
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index b1cf15a..7fee1cd 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -304,7 +304,7 @@
         # However to avoid lvm MDA corruption we still need to set the volume
         # as read-only on domain version 2. The corruption is triggered on the
         # HSMs that are using the resource manager to prepare the volume chain.
-        if int(sdCache.produce(self.sdUUID).getVersion()) < 3:
+        if int(sdCache.produce_manifest(self.sdUUID).getVersion()) < 3:
             self._setrw(rw=rw)
 
     def setLeaf(self):
@@ -434,7 +434,7 @@
         """
         puuid = self.getParent()
         if puuid and puuid != sc.BLANK_UUID:
-            sd_manifest = sdCache.produce(self.sdUUID).manifest
+            sd_manifest = sdCache.produce_manifest(self.sdUUID)
             return sd_manifest.produceVolume(self.imgUUID, puuid)
         return None
 


-- 
To view, visit https://gerrit.ovirt.org/60347
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If64a3ff30124b6c3bee86101510379ac72678ac6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to