From: Tim Deegan Subject: [PATCH] Actually set a HVM domain's time offset when it sets the RTC Date: Wed, 18 Mar 2009 11:52:50 +0000 Message-ID: <20090318115250.GD11733@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="H1spWtNR+x+ondvy" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --H1spWtNR+x+ondvy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Actually set a HVM domain's time offset when it sets the RTC rather than just telling qemu about it. Signed-off-by: Tim Deegan --H1spWtNR+x+ondvy Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=timeoffset diff -r 33270c9a3d2f xen/arch/x86/hvm/rtc.c --- a/xen/arch/x86/hvm/rtc.c Wed Mar 18 11:37:59 2009 +0000 +++ b/xen/arch/x86/hvm/rtc.c Wed Mar 18 11:51:10 2009 +0000 @@ -160,6 +160,7 @@ 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 @@ 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); } --H1spWtNR+x+ondvy Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --H1spWtNR+x+ondvy--