ia64/xen-unstable

changeset 19390:b8242b82b561

Actually set a HVM domain's time offset when it sets the RTC

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 18 13:24:42 2009 +0000 (2009-03-18)
parents c1aa7b9d4842
children fe4b23bd3a95
files xen/arch/x86/hvm/rtc.c
line diff
     1.1 --- a/xen/arch/x86/hvm/rtc.c	Wed Mar 18 11:51:30 2009 +0000
     1.2 +++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 18 13:24:42 2009 +0000
     1.3 @@ -160,6 +160,7 @@ static inline int from_bcd(RTCState *s, 
     1.4  static void rtc_set_time(RTCState *s)
     1.5  {
     1.6      struct tm *tm = &s->current_tm;
     1.7 +    struct domain *d = vrtc_domain(s);
     1.8      unsigned long before, after; /* XXX s_time_t */
     1.9        
    1.10      ASSERT(spin_is_locked(&s->lock));
    1.11 @@ -180,6 +181,12 @@ static void rtc_set_time(RTCState *s)
    1.12  
    1.13      after = mktime(tm->tm_year, tm->tm_mon, tm->tm_mday,
    1.14                     tm->tm_hour, tm->tm_min, tm->tm_sec);
    1.15 +
    1.16 +    /* We use the guest's setting of the RTC to define the local-time 
    1.17 +     * offset for this domain. */
    1.18 +    d->time_offset_seconds += (after - before);
    1.19 +    update_domain_wallclock_time(d);
    1.20 +    /* Also tell qemu-dm about it so it will be remembered for next boot. */
    1.21      send_timeoffset_req(after - before);
    1.22  }
    1.23