]> xenbits.xensource.com Git - pvdrivers/win/xeniface.git/commitdiff
Get rid of bogus time adjustment
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 16 Sep 2019 13:23:08 +0000 (14:23 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 16 Sep 2019 15:30:15 +0000 (16:30 +0100)
Xen maintains synchronization between the wallclock (as reported in the
shared info) and the emulated RTC. Thus all the guest agent needs to know,
to correctly interpret the wallclock, is whether Windows is setting the
RTC in local time or UTC. No adjustment of the wallclock is required.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenagent/service.cpp
src/xenagent/service.h

index a77ff2395a1cdbbfa09283a75f02b39cdc8e5525..8f8f4455cbe9ed00a8378736bda1c327577090c0 100644 (file)
@@ -404,28 +404,6 @@ bool CXenIfaceCreator::IsRTCInUTC()
     return val;
 }
 
-void CXenIfaceCreator::AdjustXenTimeToUTC(FILETIME* now)
-{
-    std::string vm;
-    if (!m_device->StoreRead("vm", vm))
-        return;
-
-    std::string offs;
-    if (!m_device->StoreRead(vm + "/rtc/timeoffset", offs))
-        return;
-
-    long offset = (long)atoi(offs.c_str());
-
-    ULARGE_INTEGER lnow;
-    lnow.LowPart  = now->dwLowDateTime;
-    lnow.HighPart = now->dwHighDateTime;
-
-    lnow.QuadPart -= ((LONGLONG)offset * 1000000);
-
-    now->dwLowDateTime  = lnow.LowPart;
-    now->dwHighDateTime = lnow.HighPart;
-}
-
 void CXenIfaceCreator::SetXenTime()
 {
     bool IsUTC = IsRTCInUTC();
@@ -440,9 +418,6 @@ void CXenIfaceCreator::SetXenTime()
     if (!m_device->SharedInfoGetTime(&now))
         return;
 
-    if (IsUTC)
-        AdjustXenTimeToUTC(&now);
-
     SYSTEMTIME sys = { 0 };
     if (!FileTimeToSystemTime(&now, &sys))
         return;
index 9547177e6b24aec9b15b183ad30d373c2d0134c4..e886de60fa6b36125fad76a793263d9954d0efd8 100644 (file)
@@ -86,7 +86,6 @@ private:
     void StopSlateModeWatch();
     void AcquireShutdownPrivilege();
     bool IsRTCInUTC();
-    void AdjustXenTimeToUTC(FILETIME* time);
     void SetXenTime();
 
 private: