Hello Federico Simoncelli, Vinzenz Feenstra, Dan Kenigsberg, Francesco Romani,
I'd like you to do a code review. Please visit http://gerrit.ovirt.org/26594 to review the following change. 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 domains within the pool are from the same type. 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 Bug-Url: https://bugzilla.redhat.com/1082941 Signed-off-by: Arik Hadas <aha...@redhat.com> Reviewed-on: http://gerrit.ovirt.org/26407 Reviewed-by: Francesco Romani <from...@redhat.com> Reviewed-by: Vinzenz Feenstra <vfeen...@redhat.com> Reviewed-by: Federico Simoncelli <fsimo...@redhat.com> Reviewed-by: Dan Kenigsberg <dan...@redhat.com> --- M vdsm/vm.py 1 file changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/26594/1 diff --git a/vdsm/vm.py b/vdsm/vm.py index dbba916..12a9f9c 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -3877,12 +3877,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') @@ -4016,12 +4019,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/26594 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cebdbba2cc763963b64dcbc142f979802f18c16 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.4 Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Vinzenz Feenstra <vfeen...@redhat.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches