qemu: Do not report completed stats until the job finishes

We would happily report and free statistics of a completed migration
even before it actually completed (on the source host while migration is
in the Finish phase).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-02-23 12:40:47 +01:00
parent cb483a68fd
commit a2374edf08

View File

@ -13016,7 +13016,9 @@ qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver,
goto cleanup;
}
if (completed)
if (completed && priv->job.current)
info = NULL;
else if (completed)
info = priv->job.completed;
else
info = priv->job.current;