[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [xen] Update the hvm rtc clock state if the domain's time offset is changed.
# HG changeset patch # User Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx> # Date 1173369092 0 # Node ID 345effaf2258f1059172023d542ff011468d702c # Parent 7e2f7e8b63d3013efc0e009bc16509daa011a3be [xen] Update the hvm rtc clock state if the domain's time offset is changed. The settimeoffset domctl had no effect on hvm domains since the offset was only read in rtc_init which is done when the domain is created. Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx> --- xen/arch/x86/hvm/rtc.c | 17 ++++++++++++++--- xen/include/asm-x86/hvm/vpt.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff -r 7e2f7e8b63d3 -r 345effaf2258 xen/arch/x86/hvm/rtc.c --- a/xen/arch/x86/hvm/rtc.c Thu Mar 08 15:35:28 2007 +0000 +++ b/xen/arch/x86/hvm/rtc.c Thu Mar 08 15:51:32 2007 +0000 @@ -174,6 +174,11 @@ static void rtc_copy_date(RTCState *s) { const struct tm *tm = &s->current_tm; + if (s->time_offset_seconds != s->pt.vcpu->domain->time_offset_seconds) { + s->current_tm = gmtime(get_localtime(s->pt.vcpu->domain)); + s->time_offset_seconds = s->pt.vcpu->domain->time_offset_seconds; + } + s->hw.cmos_data[RTC_SECONDS] = to_bcd(s, tm->tm_sec); s->hw.cmos_data[RTC_MINUTES] = to_bcd(s, tm->tm_min); if ( s->hw.cmos_data[RTC_REG_B] & RTC_24H ) @@ -211,9 +216,15 @@ static int get_days_in_month(int month, } /* update 'tm' to the next second */ -static void rtc_next_second(struct tm *tm) -{ +static void rtc_next_second(RTCState *s) +{ + struct tm *tm = &s->current_tm; int days_in_month; + + if (s->time_offset_seconds != s->pt.vcpu->domain->time_offset_seconds) { + s->current_tm = gmtime(get_localtime(s->pt.vcpu->domain)); + s->time_offset_seconds = s->pt.vcpu->domain->time_offset_seconds; + } tm->tm_sec++; if ((unsigned)tm->tm_sec >= 60) { @@ -258,7 +269,7 @@ static void rtc_update_second(void *opaq } else { - rtc_next_second(&s->current_tm); + rtc_next_second(s); if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) ) s->hw.cmos_data[RTC_REG_A] |= RTC_UIP; diff -r 7e2f7e8b63d3 -r 345effaf2258 xen/include/asm-x86/hvm/vpt.h --- a/xen/include/asm-x86/hvm/vpt.h Thu Mar 08 15:35:28 2007 +0000 +++ b/xen/include/asm-x86/hvm/vpt.h Thu Mar 08 15:51:32 2007 +0000 @@ -92,6 +92,7 @@ typedef struct RTCState { struct timer second_timer; struct timer second_timer2; struct periodic_time pt; + int32_t time_offset_seconds; } RTCState; #define FREQUENCE_PMTIMER 3579545 /* Timer should run at 3.579545 MHz */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |