Francesco Romani has uploaded a new change for review.
Change subject: vm: fix odd migration progress reporting ......................................................................
vm: fix odd migration progress reporting
migration progress should not start from 100, otherwise the user will see smething like:
progress: 100 -> 0% ... X% ... 100%
A real-word scenario that shows the need for this patch is the following: If during the the initialization of migration we experience some delay, for example DNS resolve issues, libvirt returns 0 for all the progress values, and that incorrectly triggered the old shortcut, leading to an incorrect initial progress value of 100.
Change-Id: Ib2bfefb3ffc7d21f6a554f00eac6934fa89ab669 Bug-Url: https://bugzilla.redhat.com/1104670 Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/vm.py 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/62/28362/1
diff --git a/vdsm/vm.py b/vdsm/vm.py index 69f7cb4..a21d08b 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -765,7 +765,7 @@
def run(self): def calculateProgress(remaining, total): - if remaining == 0: + if remaining == 0 and total: return 100 progress = 100 - 100 * remaining / total if total else 0 return progress if (progress < 100) else 99