[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH v2] Get rid of bogus time adjustment


  • To: <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <paul.durrant@xxxxxxxxxx>
  • Date: Mon, 16 Sep 2019 16:32:14 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
  • Delivery-date: Mon, 16 Sep 2019 15:32:32 +0000
  • Ironport-sdr: yjZULmxtZ9vMSY6gppi8zvVPIHcPxlM8bFOXMYuyVwWZqeGK8q8Vdkq2CCGlYcN9F0kER/g+c+ 5XGQuvJ1IFfge6PI4fGRCivP/FCOiJzd+8lvIRh5PVeJcR/DJIkzVkzPxiSm/r994LsVcRSKbG v/HoIPDFesQ7yKD9TR+hk8bIaiVwelYI3IOQuagpWeELFMh/I9VNa1kyxJmQsQ6/WetsqciLeO oGOGQRbZyI1w9aRwa1p7xggeKKahlX491SD1g2C3yDMDHcSmYqV9G/hl0xzmaymnBYQqqht4om uks=
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

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@xxxxxxxxxx>
---

v2:
 - Remove class method declaration

---
 src/xenagent/service.cpp | 25 -------------------------
 src/xenagent/service.h   |  1 -
 2 files changed, 26 deletions(-)

diff --git a/src/xenagent/service.cpp b/src/xenagent/service.cpp
index a77ff23..8f8f445 100644
--- a/src/xenagent/service.cpp
+++ b/src/xenagent/service.cpp
@@ -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;
diff --git a/src/xenagent/service.h b/src/xenagent/service.h
index 9547177..e886de6 100644
--- a/src/xenagent/service.h
+++ b/src/xenagent/service.h
@@ -86,7 +86,6 @@ private:
     void StopSlateModeWatch();
     void AcquireShutdownPrivilege();
     bool IsRTCInUTC();
-    void AdjustXenTimeToUTC(FILETIME* time);
     void SetXenTime();
 
 private:
-- 
2.5.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.