Skip to contentSkip to conversation

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

PATCH New Tim Deegan 1 participant 1 message Mar 18, 2009

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

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

Actually set a HVM domain's time offset when it sets the RTC rather than just telling qemu about it.

xen/arch/x86/hvm/rtc.c +7 -0
diff -r 33270c9a3d2f xen/arch/x86/hvm/rtc.c
@@ -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);
 }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel