mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-13 17:18:01 +03:00
tools: virsh-domain: refactor variable initialization
Signed-off-by: Shaleen Bathla <shaleen.bathla@oracle.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
4b5a9e34ad
commit
51cfca2210
@ -1722,12 +1722,10 @@ static void
|
|||||||
virshPrintJobProgress(const char *label, unsigned long long remaining,
|
virshPrintJobProgress(const char *label, unsigned long long remaining,
|
||||||
unsigned long long total)
|
unsigned long long total)
|
||||||
{
|
{
|
||||||
int progress;
|
int progress = 100;
|
||||||
|
|
||||||
if (remaining == 0) {
|
/* if remaining == 0 migration has completed */
|
||||||
/* migration has completed */
|
if (remaining != 0) {
|
||||||
progress = 100;
|
|
||||||
} else {
|
|
||||||
/* use float to avoid overflow */
|
/* use float to avoid overflow */
|
||||||
progress = (int)(100.0 - remaining * 100.0 / total);
|
progress = (int)(100.0 - remaining * 100.0 / total);
|
||||||
if (progress >= 100) {
|
if (progress >= 100) {
|
||||||
|
Loading…
Reference in New Issue
Block a user