qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] re-set rtc date on reset handler
@ 2009-09-01 16:22 Glauber Costa
  2009-09-01 16:56 ` Blue Swirl
  0 siblings, 1 reply; 19+ messages in thread
From: Glauber Costa @ 2009-09-01 16:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

guests without a stable timesource such as kvm-clock will grab the wallclock
from our rtc chip. However, we only sync the date when we first launch qemu.
If a guest goes through a series of reboot cycles, it will slowly see time
getting far behind the host.

The proposal of this patch is to set the date to host clock again in the reset
handler. With this patch, I see a Fedora guest keeping its clock in sync upon
an ulimited number of reboots.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 hw/mc146818rtc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 5c8676e..e71a9da 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -586,6 +586,8 @@ static void rtc_reset(void *opaque)
     if (rtc_td_hack)
 	    s->irq_coalesced = 0;
 #endif
+
+    rtc_set_date_from_host(s);
 }
 
 RTCState *rtc_init_sqw(int base, qemu_irq irq, qemu_irq sqw_irq, int base_year)
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-09-09 18:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-01 16:22 [Qemu-devel] [PATCH] re-set rtc date on reset handler Glauber Costa
2009-09-01 16:56 ` Blue Swirl
2009-09-01 23:00   ` Glauber Costa
2009-09-08 14:55     ` Dor Laor
2009-09-08 16:15   ` [Qemu-devel] " Jan Kiszka
2009-09-08 16:50     ` Jan Kiszka
2009-09-08 17:00       ` Jan Kiszka
2009-09-09 12:28         ` Dor Laor
2009-09-09 12:57           ` Jan Kiszka
2009-09-09 13:27             ` Avi Kivity
2009-09-09 13:31               ` Jan Kiszka
2009-09-09 15:04                 ` Avi Kivity
2009-09-09 15:34                   ` Anthony Liguori
2009-09-09 16:09                     ` Gleb Natapov
2009-09-09 17:52                       ` Anthony Liguori
2009-09-09 18:40                         ` Gleb Natapov
2009-09-09 18:50                           ` Anthony Liguori
2009-09-09 18:25                     ` Avi Kivity
2009-09-09 18:33                       ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).