Commit ee22c2f7dbcc59d9b0c0c9e08fafc9c4759b37fc
1 parent
be3edd95
-localtime option
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@871 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
11 additions
and
1 deletions
hw/pc.c
... | ... | @@ -110,7 +110,10 @@ static void cmos_init(int ram_size, int boot_device) |
110 | 110 | |
111 | 111 | /* set the CMOS date */ |
112 | 112 | time(&ti); |
113 | - tm = gmtime(&ti); | |
113 | + if (rtc_utc) | |
114 | + tm = gmtime(&ti); | |
115 | + else | |
116 | + tm = localtime(&ti); | |
114 | 117 | rtc_set_date(s, tm); |
115 | 118 | |
116 | 119 | val = to_bcd(s, (tm->tm_year / 100) + 19); | ... | ... |
vl.c
... | ... | @@ -129,6 +129,7 @@ int vm_running; |
129 | 129 | int audio_enabled = 0; |
130 | 130 | int pci_enabled = 0; |
131 | 131 | int prep_enabled = 0; |
132 | +int rtc_utc = 1; | |
132 | 133 | |
133 | 134 | /***********************************************************/ |
134 | 135 | /* x86 ISA bus support */ |
... | ... | @@ -2015,6 +2016,7 @@ enum { |
2015 | 2016 | QEMU_OPTION_no_code_copy, |
2016 | 2017 | QEMU_OPTION_pci, |
2017 | 2018 | QEMU_OPTION_prep, |
2019 | + QEMU_OPTION_localtime, | |
2018 | 2020 | }; |
2019 | 2021 | |
2020 | 2022 | typedef struct QEMUOption { |
... | ... | @@ -2065,6 +2067,7 @@ const QEMUOption qemu_options[] = { |
2065 | 2067 | #ifdef TARGET_PPC |
2066 | 2068 | { "prep", 0, QEMU_OPTION_prep }, |
2067 | 2069 | #endif |
2070 | + { "localtime", 0, QEMU_OPTION_localtime }, | |
2068 | 2071 | { NULL }, |
2069 | 2072 | }; |
2070 | 2073 | |
... | ... | @@ -2341,6 +2344,9 @@ int main(int argc, char **argv) |
2341 | 2344 | case QEMU_OPTION_prep: |
2342 | 2345 | prep_enabled = 1; |
2343 | 2346 | break; |
2347 | + case QEMU_OPTION_localtime: | |
2348 | + rtc_utc = 0; | |
2349 | + break; | |
2344 | 2350 | } |
2345 | 2351 | } |
2346 | 2352 | } | ... | ... |