Adam Litke has posted comments on this change. Change subject: Live Merge: Return more info from _driveGetActualVolumeChain ......................................................................
Patch Set 4: (5 comments) http://gerrit.ovirt.org/#/c/31364/4//COMMIT_MSG Commit Message: Line 9: In followup patches, we want to return more information about each path Line 10: component from _driveGetActualVolumeChain. We need the actual path as Line 11: given in the domain XML in order to properly update our metadata after Line 12: an active layer merge. We also want to use this function to return high Line 13: write watermark information for block volumes. This patch just converts > Why do we want to do that? Currently we monitor every 2 seconds the write w For Live Merge, we need the watermark for internal volumes too. The current code only monitors the write watermark for the leaf volume. Line 14: the format returned by _driveGetActualVolumeChain from a simple list to Line 15: a list of named tuples. Line 16: Line 17: Change-Id: I01d142a68903048accc95eb04d9930c326965db0 Line 11: given in the domain XML in order to properly update our metadata after Line 12: an active layer merge. We also want to use this function to return high Line 13: write watermark information for block volumes. This patch just converts Line 14: the format returned by _driveGetActualVolumeChain from a simple list to Line 15: a list of named tuples. > The problem with this change is that it make the code more ugly, just to ge See above. Line 16: Line 17: Change-Id: I01d142a68903048accc95eb04d9930c326965db0 Line 18: Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109920 http://gerrit.ovirt.org/#/c/31364/4/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 194: VolumeChainEntry = namedtuple('VolumeChainEntry', ['uuid']) Line 195: Line 196: Line 197: def _volumeChainToVolumeIds(chain): Line 198: return [x.uuid for x in chain] > Please use meaningful variables names, like "vol" or "drive". I was asked by Francesco to make it a helper. No problem inlining it and/or moving it to the bottom though. Line 199: Line 200: Line 201: class VmStatsThread(AdvancedStatsThread): Line 202: MBPS_TO_BPS = 10 ** 6 / 8 Line 5538: return Line 5539: Line 5540: curVols = [x['volumeID'] for x in drive.volumeChain] Line 5541: ret = self._driveGetActualVolumeChain(drive) Line 5542: if ret is None: > It would be nice if we always use the same name for the result of self._dri ok. Line 5543: self.log.debug("Unable to determine volume chain. Skipping volume " Line 5544: "chain synchronization for drive %s", drive.name) Line 5545: return Line 5546: Line 5543: self.log.debug("Unable to determine volume chain. Skipping volume " Line 5544: "chain synchronization for drive %s", drive.name) Line 5545: return Line 5546: Line 5547: volumes = _volumeChainToVolumeIds(ret) > This is not the best name for this, since we have both volume objects and v ok. Line 5548: self.log.debug("vdsm chain: %s, libvirt chain: %s", curVols, volumes) Line 5549: Line 5550: # Ask the storage to sync metadata according to the new chain Line 5551: self.cif.irs.imageSyncVolumeChain(drive.domainID, drive.imageID, -- To view, visit http://gerrit.ovirt.org/31364 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01d142a68903048accc95eb04d9930c326965db0 Gerrit-PatchSet: 4 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
