pl031: switch clock base to rtc_clock
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 30 Mar 2012 10:31:23 +0000 (10:31 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 30 Mar 2012 10:31:23 +0000 (10:31 +0000)
commitb0f26631bc51790069b0c0b3935b20f9a54e3ab3
treeabe02af6fd1048eeb64cc4b8dcd595a26b1fb608
parentac204b8f67d17881bd61f2439005d02b1de3736e
pl031: switch clock base to rtc_clock

This lets the user specify the desired semantics.  By default, the RTC
will follow adjustments from the host's NTP client, and will remain in
sync when the virtual machine is stopped.  The previous behavior, which
provides determinism with both icount and qtest, remains available with
"-rtc clock=vm".

pl031 supports migration, so we need to convert the time base from
rtc_clock to vm_clock and back for backwards compatibility.  (The
rtc_clock may not be synchronized on the two machines, especially with
savevm/loadvm, so the conversion is needed anyway.  And since any time
base will do, why not pick the one base that is backwards compatible).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/pl031.c