Francesco Romani has uploaded a new change for review. Change subject: virt: stats: move migration stats in a method ......................................................................
virt: stats: move migration stats in a method this patch moves the migration statistics fields in a separate method, for the sake of consistency. No functional changes. Change-Id: I73192e687d709645179e28888d6b697dd705b940 Signed-off-by: Francesco Romani <[email protected]> --- M vdsm/virt/vm.py 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/52/26552/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 8f84dff..7c424a6 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2427,8 +2427,7 @@ int(self.conf['memSize']) * 100) stats['memUsage'] = utils.convertToStr(int(memUsage)) stats['balloonInfo'] = self._getBalloonInfo() - if self.isMigrating(): - stats['migrationProgress'] = self.migrateStatus()['progress'] + self._addMigrationVmStats(stats) return stats def _addExitedVmStats(self, stats): @@ -2516,6 +2515,10 @@ else: stats['status'] = self.lastStatus + def _addMigrationVmStats(self, stats): + if self.isMigrating(): + stats['migrationProgress'] = self.migrateStatus()['progress'] + def isMigrating(self): return self._migrationSourceThread.isAlive() -- To view, visit http://gerrit.ovirt.org/26552 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73192e687d709645179e28888d6b697dd705b940 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
