Change in vdsm[master]: storage: Cleanup sd.getVAllocSize redirection

alitke at redhat.com alitke at redhat.com
Thu Aug 13 20:42:07 UTC 2015


Adam Litke has uploaded a new change for review.

Change subject: storage: Cleanup sd.getVAllocSize redirection
......................................................................

storage: Cleanup sd.getVAllocSize redirection

For file-based storage, getVSize and getVAllocSize have different
implementations.  For block storage, getVAllocSize just calls getVSize.
The logic stating that the implementation of these functions is the same
on block storage should be part of the BlockStorageDomainManifest not
the BlockStorageDomain.  Therefore, we create getVAllocSize in the
BlockStorageDomainManifest and have it call its own getVSize.  Now block
and file StorageDomains can share the same indirection method for
getVAllocSize (just as they do for getVSize).

Change-Id: I55a277caeee1747e8c9e2869a557d3b97fa767ec
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/sd.py
3 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/44829/1

diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 127150e..9e12678 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -437,6 +437,9 @@
 
         return int(size)
 
+    def getVAllocSize(self, imgUUUID, volUUID):
+        return self.getVSize(imgUUUID, volUUID)
+
     def getLeasesFilePath(self):
         # TODO: Determine the path without activating the LV
         lvm.activateLVs(self.sdUUID, [sd.LEASES])
@@ -646,9 +649,6 @@
         Return a type specific volume generator object
         """
         return blockVolume.BlockVolume
-
-    def getVAllocSize(self, imgUUID, volUUID):
-        return self._manifest.getVSize(imgUUID, volUUID)
 
     def validateCreateVolumeParams(self, volFormat, srcVolUUID,
                                    preallocate=None):
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 4eb2931..8e50a09 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -335,9 +335,6 @@
         """
         return fileVolume.FileVolume
 
-    def getVAllocSize(self, imgUUID, volUUID):
-        return self._manifest.getVAllocSize(imgUUID, volUUID)
-
     def getVolumeLease(self, imgUUID, volUUID):
         """
         Return the volume lease (leasePath, leaseOffset)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 5cdb70b..49abe5a 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -373,6 +373,9 @@
     def getVSize(self, imgUUID, volUUID):
         return self._manifest.getVSize(imgUUID, volUUID)
 
+    def getVAllocSize(self, imgUUID, volUUID):
+        return self._manifest.getVAllocSize(imgUUID, volUUID)
+
     def prepareMailbox(self):
         """
         This method has been introduced in order to prepare the mailbox


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I55a277caeee1747e8c9e2869a557d3b97fa767ec
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