Adam Litke has posted comments on this change. Change subject: Live Merge: Update path using libvirt supplied value ......................................................................
Patch Set 6: (2 comments) http://gerrit.ovirt.org/#/c/31365/6/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 5529: if not sourceXML: Line 5530: break Line 5531: sourceAttr = ('file', 'dev')[drive.blockDev] Line 5532: path = sourceXML.getAttribute(sourceAttr) Line 5533: entry = VolumeChainEntry(pathToVolID(drive, path), path) > It would be little nicer to do: Sure. It seems that fromani was encouraging me to cut down on intermediate variables so I changed it to work this way in a previous iteration. Line 5534: volChain.insert(0, entry) Line 5535: bsXML = findElement(diskXML, 'backingStore') Line 5536: if not bsXML: Line 5537: break Line 5585: Line 5586: # Remove any components of the volumeChain which are no longer present Line 5587: newChain = [x for x in device['volumeChain'] Line 5588: if x['volumeID'] in volumes] Line 5589: device['volumeChain'] = drive.volumeChain = newChain > Can we simplify this code by using data in chain to overwrite data in devic Not really, because each element of device['volumeChain'] is a dictionary and there is more information in there than we can reasonably track (or would want to rediscover. Since Live Merge only deletes an entry from the chain it is much easier to do it this way in my opinion. Line 5590: Line 5591: def handleBlockJobEvent(self, jobID, drive, mode): Line 5592: if mode == 'finished': Line 5593: self.log.info("Live merge job completed (job %s)", jobID) -- To view, visit http://gerrit.ovirt.org/31365 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie341333ad934645c0fe4f2fd31733c459d306d9a Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Nir Soffer <[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
