Change in vdsm[master]: VolumeMetadata: Move getParentVolume

alitke at redhat.com alitke at redhat.com
Mon Jul 27 20:39:05 UTC 2015


Adam Litke has uploaded a new change for review.

Change subject: VolumeMetadata: Move getParentVolume
......................................................................

VolumeMetadata: Move getParentVolume

Move getParentVolume into VolumeMetadata.  If HSM configured sdCache to
return StorageDomainManifest objects then this will return
VolumeMetadata objects.  Otherwise it will continue to return Volume
objects as it always has.

Change-Id: I74def8861e0b7b97ca4d218a969440ccba7f07dd
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M vdsm/storage/volume.py
1 file changed, 11 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/44042/1

diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index c40ba77..f7e5bc0 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -485,6 +485,16 @@
         """
         pass  # Do not remove this method or the V3 upgrade will fail.
 
+    def getParentVolume(self):
+        """
+        Return parent volume object
+        """
+        puuid = self.getParent()
+        if puuid and puuid != BLANK_UUID:
+            return sdCache.produce(self.sdUUID).produceVolume(self.imgUUID,
+                                                              puuid)
+        return None
+
 
 class Volume(object):
     log = logging.getLogger('Storage.Volume')
@@ -1128,11 +1138,7 @@
         """
         Return parent volume object
         """
-        puuid = self.getParent()
-        if puuid and puuid != BLANK_UUID:
-            return sdCache.produce(self.sdUUID).produceVolume(self.imgUUID,
-                                                              puuid)
-        return None
+        return self.md.getParentVolume()
 
     def setParent(self, puuid):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74def8861e0b7b97ca4d218a969440ccba7f07dd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>


More information about the vdsm-patches mailing list