Arik Hadas has uploaded a new change for review.

Change subject: pad memory volume only when the storage domain is file based
......................................................................

pad memory volume only when the storage domain is file based

Memory volume should be padded only when the storage domain in which the
memory volume resides is file-based device. We used to check the type of
the storage pool, assuming that all the domain within the pool are from
the same time. This assumption is not true anymore, as we can have
different types of storage domains in the same storage pool, in case of
shared storage. So from now on, we'll check the type of the storage
domain in which the memory volume is in, and only if it is filed-based
device we'll pad the volume.

Change-Id: I0cebdbba2cc763963b64dcbc142f979802f18c16
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 10 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/26407/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0e19235..6711bc6 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3543,12 +3543,15 @@
                     '_srcDomXML': self._dom.XMLDesc(0),
                     'elapsedTimeOffset': time.time() - self._startTime}
 
-        def _padMemoryVolume(memoryVolPath, spType, sdUUId):
-            if spType == sd.NFS_DOMAIN:
-                oop.getProcessPool(sdUUID).fileUtils. \
-                    padToBlockSize(memoryVolPath)
-            else:
-                fileUtils.padToBlockSize(memoryVolPath)
+        def _padMemoryVolume(memoryVolPath, sdUUID):
+            sdType = sd.name2type(
+                self.cif.irs.getStorageDomainInfo(sdUUID)['info']['type'])
+            if sdType in sd.FILE_DOMAIN_TYPES:
+                if sdType == sd.NFS_DOMAIN:
+                    oop.getProcessPool(sdUUID).fileUtils. \
+                        padToBlockSize(memoryVolPath)
+                else:
+                    fileUtils.padToBlockSize(memoryVolPath)
 
         snap = xml.dom.minidom.Element('domainsnapshot')
         disks = xml.dom.minidom.Element('disks')
@@ -3682,12 +3685,7 @@
             # This code should be removed once qemu-img will handle files
             # with size that is not multiple of block size correctly.
             if memoryParams:
-                sdUUID = memoryVol['domainID']
-                spUUID = memoryVol['poolID']
-                spType = sd.name2type(
-                    self.cif.irs.getStoragePoolInfo(spUUID)['info']['type'])
-                if spType in sd.FILE_DOMAIN_TYPES:
-                    _padMemoryVolume(memoryVolPath, spType, sdUUID)
+                _padMemoryVolume(memoryVolPath, memoryVol['domainID'])
                 self.cif.teardownVolumePath(memoryVol)
 
             for drive in newDrives.values():  # Update the drive information


-- 
To view, visit http://gerrit.ovirt.org/26407
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0cebdbba2cc763963b64dcbc142f979802f18c16
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to