Francesco Romani has uploaded a new change for review. Change subject: migration: return copy of internal status ......................................................................
migration: return copy of internal status SourceThread accumulate progress, status and response data in one field, making it harder than necessary to make changes and to track the current status without actually executing the code. To untangle this spaghetti ball, the first step is to use separate status-related field, and to construct a response only when asked to. To preserve backward compatibility, we augment the response with the same fields we used before. Change-Id: I080b8d461ffef4fe7053b36326175568d39e90ed Signed-off-by: Francesco Romani <from...@redhat.com> --- M vdsm/virt/migration.py 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/49523/1 diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py index 23f8e8a..29b7536 100644 --- a/vdsm/virt/migration.py +++ b/vdsm/virt/migration.py @@ -113,16 +113,18 @@ """ Get the status of the migration. """ + status = utils.picklecopy(self._last_status) + if self._monitorThread is not None: # fetch migration status from the monitor thread self._progress = self._monitorThread.progress - self._last_status['progress'] = self._progress + status['progress'] = self._progress stat = self._vm._dom.jobStats(libvirt.VIR_DOMAIN_JOB_STATS_COMPLETED) if 'downtime_net' in stat: - self._last_status['downtime'] = stat['downtime_net'] + status['downtime'] = stat['downtime_net'] - return self._last_status + return status def _createClient(self, port): sslctx = sslutils.create_ssl_context() -- To view, visit https://gerrit.ovirt.org/49523 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I080b8d461ffef4fe7053b36326175568d39e90ed Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches