Federico Simoncelli has posted comments on this change. Change subject: core: generify "streamDownloadImage" related methods ......................................................................
Patch Set 3: Code-Review+1 (2 comments) Ok but looking at the existing code we need a spin off of another two patches. http://gerrit.ovirt.org/#/c/26761/3/vdsm/storage/image.py File vdsm/storage/image.py: Line 1182: vol = self._activateVolumeForImportExport(domain, imgUUID, volUUID) Line 1183: try: Line 1184: # Extend the volume (if relevant) to the image size Line 1185: vol.extend(imageSharing.getLengthFromArgs(methodArgs) Line 1186: / volume.BLOCK_SIZE) I just noticed that this is going to truncate the image if it's not a multiple of BLOCK_SIZE. Have a separate patch with: (imageSharing.getLengthFromArgs(methodArgs) + BLOCK_SIZE - 1) / BLOCK_SIZE Line 1187: imageSharing.copyToImage(vol.getVolumePath(), methodArgs) Line 1188: finally: http://gerrit.ovirt.org/#/c/26761/3/vdsm/storage/imageSharing.py File vdsm/storage/imageSharing.py: Line 75: Line 76: Line 77: def copyToImage(dstImgPath, methodArgs): Line 78: bytes_left = getLengthFromArgs(methodArgs) Line 79: fileObj = methodArgs['fileObj'] fileObj doesn't belong to methodArgs. Have a separate patch where we evaluate to pass it separately: def copyToImage(dstImgPath, fileObj, methodArgs): ... Line 80: Line 81: cmd = [constants.EXT_DD, "of=%s" % dstImgPath, "bs=%s" % constants.MEGAB] Line 82: p = utils.execCmd(cmd, sudo=False, sync=False, Line 83: deathSignal=signal.SIGKILL) -- To view, visit http://gerrit.ovirt.org/26761 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c73374681b5a5fc9fd0cb81020138fb5c8bfe69 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Liron Ar <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Liron Ar <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: Yoav Kleinberger <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
