Changeset 69994 in vbox
- Timestamp:
- Dec 7, 2017 5:08:49 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119501
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
r69993 r69994 537 537 538 538 /* 539 * Initialize the last host time to prevent log message. 539 * Initialize the last host and guest times to prevent log message. 540 * We also tracks whether we set the time in the previous loop. 540 541 */ 541 542 RTTIMESPEC HostLast; 542 543 if (RT_FAILURE(VbglR3GetHostTime(&HostLast))) 543 544 RTTimeSpecSetNano(&HostLast, 0); 545 RTTIMESPEC GuestLast; 546 RTTimeNow(&GuestLast); 547 bool fSetTimeLastLoop = false; 544 548 545 549 /* … … 617 621 } 618 622 623 bool fSetTimeInThisLoop = false; 619 624 uint32_t AbsDriftMilli = RTTimeSpecGetMilli(&AbsDrift); 620 625 if (AbsDriftMilli > MinAdjust) … … 632 637 vgsvcTimeSyncCancelAdjust(); 633 638 vgsvcTimeSyncSet(&Drift); 639 fSetTimeInThisLoop = true; 634 640 } 635 641 … … 645 651 vgsvcTimeSyncCancelAdjust(); 646 652 HostLast = HostNow; 653 654 /* 655 * Log radical guest time changes (we could be the cause of these, mind). 656 * Note! Right now we don't care about an extra log line after we called 657 * vgsvcTimeSyncSet. fSetTimeLastLoop helps show it though. 658 */ 659 int64_t cNsGuestDelta = RTTimeSpecGetNano(&GuestNow) - RTTimeSpecGetNano(&GuestLast); 660 if ((uint64_t)RT_ABS(cNsGuestDelta) > RT_NS_1HOUR / 2) 661 vgsvcTimeSyncLog(0, "vgsvcTimeSyncWorker: Radical guest time change: %'RI64ns (GuestNow=%RDtimespec GuestLast=%RDtimespec fSetTimeLastLoop=%RTbool)\n", 662 cNsGuestDelta, &GuestNow, &GuestLast, fSetTimeLastLoop); 663 GuestLast = GuestNow; 664 fSetTimeLastLoop = fSetTimeInThisLoop; 647 665 break; 648 666 }
Note:
See TracChangeset
for help on using the changeset viewer.