diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-07 16:24:33 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-07 16:24:33 +0000 |
commit | 7e0af5d09729c13900e3e7933ec2071a3646017a (patch) | |
tree | 6aca313888d9af645b1ef7e82a8c0c608a66576e /hw | |
parent | 2331d91e775db285bdf0db4e68a949e67167b27b (diff) |
added -startdate option
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3540 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mc146818rtc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 789ebd3f68..be9c63db20 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -393,11 +393,16 @@ void rtc_set_date_from_host(RTCState *s) int val; /* set the CMOS date */ - time(&ti); - if (rtc_utc) + if (rtc_start_date == -1) { + time(&ti); + if (rtc_utc) + tm = gmtime(&ti); + else + tm = localtime(&ti); + } else { + ti = rtc_start_date; tm = gmtime(&ti); - else - tm = localtime(&ti); + } rtc_set_date(s, tm); val = to_bcd(s, (tm->tm_year / 100) + 19); |