qemu: Fix a race when computing migration downtime
qemu: Fix a race when computing migration downtime

Computing a total downtime during a migration requires us to store a
time stamp when guest CPUs get stopped. The value (and all other
statistics) is then transferred to the destination to compute the
downtime. Because the stopped time stamp is stored by a STOP event
handler while the statistics which will be sent over to the destination
are copied synchronously within qemuMigrationWaitForCompletion.

Depending on the timing of STOP and MIGRATION events, we may end up
copying (and transferring) statistics without the stopped time stamp
set. Let's make sure we always use the correct time stamp.

https://bugzilla.redhat.com/show_bug.cgi?id=1282744

Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>

eskultety/libvirt,taget/libvirt,crobinso/libvirt,andreabolognani/libvirt,olafhering/libvirt,jardasgit/libvirt,olafhering/libvirt,jfehlig/libvirt,jardasgit/libvirt,jfehlig/libvirt,nertpinx/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,crobinso/libvirt,zippy2/libvirt,datto/libvirt,jardasgit/libvirt,libvirt/libvirt,datto/libvirt,eskultety/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,eskultety/libvirt,olafhering/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,taget/libvirt,libvirt/libvirt,taget/libvirt,jardasgit/libvirt,eskultety/libvirt,crobinso/libvirt,VenkatDatta/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,taget/libvirt,zippy2/libvirt,datto/libvirt,eskultety/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,olafhering/libvirt,crobinso/libvirt,zippy2/libvirt,libvirt/libvirt,datto/libvirt,VenkatDatta/libvirt,taget/libvirt,jardasgit/libvirt,andreabolognani/libvirt,zippy2/libvirt,libvirt/libvirt,datto/libvirt,nertpinx/libvirt,VenkatDatta/libvirt,nertpinx/libvirt