Re: [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2012-01-01 Thread Paolo Bonzini
On 01/01/2012 03:53 PM, Avi Kivity wrote: On 11/21/2011 08:00 PM, Paolo Bonzini wrote: Hours in 12-hour mode are in the 1-12 range, not 0-11. @@ -320,7 +324,8 @@ static void rtc_copy_date(RTCState *s) s->cmos_data[RTC_HOURS] = rtc_to_bcd(s, tm->tm_hour); } else { /* 12

Re: [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2012-01-01 Thread Avi Kivity
On 11/21/2011 08:00 PM, Paolo Bonzini wrote: > Hours in 12-hour mode are in the 1-12 range, not 0-11. > > @@ -320,7 +324,8 @@ static void rtc_copy_date(RTCState *s) > s->cmos_data[RTC_HOURS] = rtc_to_bcd(s, tm->tm_hour); > } else { > /* 12 hour format */ > -s->cmos_da

Re: [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2011-11-21 Thread Paolo Bonzini
On 11/22/2011 07:39 AM, Mark Wu wrote: Hours in 12-hour mode are in the 1-12 range, not 0-11. Interesting. I would like to know how you could find this problem. It seems linux driver never changes the format and 24-hour is default in rtc emulation code. So how did it expose and how to test it?

Re: [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2011-11-21 Thread Mark Wu
On 11/22/2011 02:00 AM, Paolo Bonzini wrote: Hours in 12-hour mode are in the 1-12 range, not 0-11. Interesting. I would like to know how you could find this problem. It seems linux driver never changes the format and 24-hour is default in rtc emulation code. So how did it expose and how to te

[Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode

2011-11-21 Thread Paolo Bonzini
Hours in 12-hour mode are in the 1-12 range, not 0-11. Signed-off-by: Paolo Bonzini --- hw/mc146818rtc.c | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 2aaca2f..14c8cb9 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rt