]> git.ipfire.org Git - thirdparty/qemu.git/commit
kvmclock: Ensure time in migration never goes backward
authorAlexander Graf <agraf@suse.de>
Fri, 5 Sep 2014 13:52:45 +0000 (10:52 -0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 24 Dec 2014 21:59:11 +0000 (15:59 -0600)
commitc35ba0d9e44271d62272671b4e5044ed7fabb7d1
tree99c54b4df29cdb5bbea54adb15c9159973dcb387
parent61048e194227847e3b3d59a7cee210755cecbabc
kvmclock: Ensure time in migration never goes backward

When we migrate we ask the kernel about its current belief on what the guest
time would be. However, I've seen cases where the kvmclock guest structure
indicates a time more recent than the kvm returned time.

To make sure we never go backwards, calculate what the guest would have seen as time at the point of migration and use that value instead of the kernel returned one when it's more recent.
This bases the view of the kvmclock after migration on the
same foundation in host as well as guest.

Signed-off-by: Alexander Graf <agraf@suse.de>
Cc: qemu-stable@nongnu.org
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 9a48bcd1b82494671c111109b0eefdb882581499)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/i386/kvm/clock.c