Changeset 75559 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Nov 18, 2018 7:46:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
r70346 r75559 127 127 static uint32_t g_TimeSyncSetThreshold = 20*60*1000; 128 128 /** Whether the next adjustment should just set the time instead of trying to 129 * adjust it. This is used to implement --timesync-set-start. */ 130 static bool volatile g_fTimeSyncSetNext = false; 129 * adjust it. This is used to implement --timesync-set-start. 130 * For purposes of setting the kernel timezone, OS/2 always starts with this. */ 131 #ifdef RT_OS_OS2 132 static bool volatile g_fTimeSyncSetOnStart = true; 133 #else 134 static bool volatile g_fTimeSyncSetOnStart = false; 135 #endif 131 136 /** Whether to set the time when the VM was restored. */ 132 137 static bool g_fTimeSyncSetOnRestore = true; … … 209 214 rc = VGSvcCheckPropExist(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-start"); 210 215 if (RT_SUCCESS(rc)) 211 g_fTimeSyncSetNext = true; 216 g_fTimeSyncSetOnStart = true; 217 } 218 if ( RT_SUCCESS(rc) 219 || rc == VERR_NOT_FOUND) 220 { 221 rc = VGSvcCheckPropExist(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/VBoxService/--timesync-no-set-start"); 222 if (RT_SUCCESS(rc)) 223 g_fTimeSyncSetOnStart = false; 212 224 } 213 225 if ( RT_SUCCESS(rc) … … 286 298 rc = VGSvcArgUInt32(argc, argv, "", pi, &g_TimeSyncSetThreshold, 0, 7*24*60*60*1000); /* a week */ 287 299 else if (!strcmp(argv[*pi], "--timesync-set-start")) 288 g_fTimeSyncSetNext = true; 300 g_fTimeSyncSetOnStart = true; 301 else if (!strcmp(argv[*pi], "--timesync-no-set-start")) 302 g_fTimeSyncSetOnStart = false; 289 303 else if (!strcmp(argv[*pi], "--timesync-set-on-restore")) 290 304 g_fTimeSyncSetOnRestore = true; … … 630 644 bool fSetTimeInThisLoop = false; 631 645 uint64_t AbsDriftMilli = RTTimeSpecGetMilli(&AbsDrift); 632 if (AbsDriftMilli > MinAdjust) 646 if ( AbsDriftMilli > MinAdjust 647 || g_fTimeSyncSetOnStart) 633 648 { 634 649 /* … … 639 654 */ 640 655 if ( AbsDriftMilli > TimeSyncSetThreshold 641 || g_fTimeSyncSet Next656 || g_fTimeSyncSetOnStart 642 657 || !vgsvcTimeSyncAdjust(&Drift)) 643 658 { … … 678 693 679 694 /* Clear the set-next/set-start flag. */ 680 g_fTimeSyncSet Next = false;695 g_fTimeSyncSetOnStart = false; 681 696 682 697 /* … … 755 770 " [--timesync-interval <ms>] [--timesync-min-adjust <ms>]\n" 756 771 " [--timesync-latency-factor <x>] [--timesync-max-latency <ms>]\n" 757 " [--timesync-set-threshold <ms>] [--timesync-set-start]\n" 772 " [--timesync-set-threshold <ms>]\n" 773 " [--timesync-set-start|--timesync-no-set-start]\n" 758 774 " [--timesync-set-on-restore|--timesync-no-set-on-restore]\n" 759 775 " [--timesync-verbosity <level>]" … … 775 791 " where to start setting the time instead of trying to\n" 776 792 " adjust it. The default is 20 min.\n" 777 " --timesync-set-start Set the time when starting the time sync service.\n" 793 " --timesync-set-start, --timesync-no-set-start \n" 794 " Set the time when starting the time sync service.\n" 795 #ifdef RT_OS_OS2 796 " Default: --timesync-set-start\n" 797 #else 798 " Default: --timesync-no-set-start\n" 799 #endif 778 800 " --timesync-set-on-restore, --timesync-no-set-on-restore\n" 779 801 " Whether to immediately set the time when the VM is\n"
Note:
See TracChangeset
for help on using the changeset viewer.