RTC: Get and set time without going through s->current_tm
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Aug 2012 16:04:12 +0000 (18:04 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 10 Sep 2012 18:52:28 +0000 (13:52 -0500)
commite2826cf4a8c89d64cdf8304f861910293f046aa8
tree20431f589391ea7ee2229e3518620e18845707f3
parent00cf57747db98c6a9e4219cea39ac3113dde6993
RTC: Get and set time without going through s->current_tm

This patch makes rtc_set_time and rtc_set_cmos work without reading
s->current_tm.  In the case of rtc_set_time I introduce a new
function that retrieves the time and stores into a given struct tm
(not hard-coded to s->current_tm).  In the case of rtc_set_cmos, the
current time is similarly taken from a struct tm rather than
s->current_tm.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/mc146818rtc.c