Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
virshPrintJobProgress(const char *label, unsigned long long remaining,
unsigned long long total)
{
- int progress;
+ int progress = 100;
- if (remaining == 0) {
- /* migration has completed */
- progress = 100;
- } else {
+ /* if remaining == 0 migration has completed */
+ if (remaining != 0) {
/* use float to avoid overflow */
progress = (int)(100.0 - remaining * 100.0 / total);
if (progress >= 100) {