]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm tools: Fix reported year in RTC emulation
authorRonald G. Minnich <rminnich@gmail.com>
Mon, 15 Oct 2012 16:20:22 +0000 (09:20 -0700)
committerPekka Enberg <penberg@kernel.org>
Tue, 16 Oct 2012 07:33:08 +0000 (10:33 +0300)
commit13d509712aa10399af28935fda45d4a5f0c9bb1f
tree322a350887588ba769c769642f071db9a571739f
parent090bf1909235fe222469e899eb82e02cf2646001
kvm tools: Fix reported year in RTC emulation

The gmtime() function returns the number of years since 1900.

On PCs, the "design" of CMOS dates is such that the years (in this case)
are years since 2000. Fix up RTC emulation as follows:

 - if year is > 99, subtract 100
 - if year is  99 (20th century) take it as it is

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
[ penberg@kernel.org: cleanups ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/hw/rtc.c