Federico Simoncelli has posted comments on this change. Change subject: virt: Refactor drive extension ......................................................................
Patch Set 5: (4 comments) http://gerrit.ovirt.org/#/c/28533/5/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 1153: """ Line 1154: return (self.VOLWM_FREE_PCT * self.volExtensionChunk * Line 1155: constants.MEGAB / 100) Line 1156: Line 1157: def getNextVolumeSize(self, curSize): In another patch: not sure here, try to evaluate if making curSize optional is better. Line 1158: """ Line 1159: Returns the next volume size in megabytes. This value is based on the Line 1160: volExtensionChunk property and it's the size that should be requested Line 1161: for the next LV extension. curSize is the current size of the volume Line 2320: self.extendDriveVolume(drive, volumeID, physical) Line 2321: Line 2322: return len(extend) > 0 Line 2323: Line 2324: def extendDriveVolume(self, vmDrive, volumeID, curSize): In another patch: make volumeID and curSize optional Line 2325: if not vmDrive.blockDev: Line 2326: return Line 2327: Line 2328: newSize = vmDrive.getNextVolumeSize(curSize) # newSize is in megabytes Line 2384: "(domainID: %s, volumeID: %s)", Line 2385: vmDrive.name, vmDrive.domainID, vmDrive.volumeID) Line 2386: self.__extendDriveVolume(vmDrive, vmDrive.volumeID, volInfo['newSize']) Line 2387: Line 2388: def __extendDriveVolume(self, vmDrive, volumeID, newSize): Here volumeID *non*-optional is correct. Your change is ok. Line 2389: volInfo = {'poolID': vmDrive.poolID, 'domainID': vmDrive.domainID, Line 2390: 'imageID': vmDrive.imageID, 'volumeID': volumeID, Line 2391: 'name': vmDrive.name, 'newSize': newSize, Line 2392: 'internal': bool(vmDrive.volumeID != volumeID)} Line 4072: return errCode['replicaErr'] Line 4073: Line 4074: try: Line 4075: self.extendDriveVolume(srcDrive, srcDrive.volumeID, Line 4076: srcDrive.apparentsize) In another patch: here you can now just use the old: self.extendDriveVolume(srcDrive) Line 4077: except Exception: Line 4078: self.log.error("Initial extension request failed for %s", Line 4079: srcDrive.name, exc_info=True) Line 4080: -- To view, visit http://gerrit.ovirt.org/28533 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62b0941958618884aea67c7929ae3822a694ff5b Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Francesco Romani <[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
