From: Keir Fraser Date: Wed, 18 Mar 2009 13:24:42 +0000 (+0000) Subject: Actually set a HVM domain's time offset when it sets the RTC X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13992^2~41 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0629adfd80e;p=xen.git Actually set a HVM domain's time offset when it sets the RTC Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index 2df9fea706..9ab69033b0 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -160,6 +160,7 @@ static inline int from_bcd(RTCState *s, int a) static void rtc_set_time(RTCState *s) { struct tm *tm = &s->current_tm; + struct domain *d = vrtc_domain(s); unsigned long before, after; /* XXX s_time_t */ ASSERT(spin_is_locked(&s->lock)); @@ -180,6 +181,12 @@ static void rtc_set_time(RTCState *s) after = mktime(tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + + /* We use the guest's setting of the RTC to define the local-time + * offset for this domain. */ + d->time_offset_seconds += (after - before); + update_domain_wallclock_time(d); + /* Also tell qemu-dm about it so it will be remembered for next boot. */ send_timeoffset_req(after - before); }