From: Oliver Kurth Date: Mon, 23 Oct 2017 21:21:22 +0000 (-0700) Subject: Add support to tools timeSync to issue w32tm resync in Windows guests. X-Git-Tag: stable-10.3.0~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d4afc447091d9fbccf89be6561accfc1e33aa9;p=thirdparty%2Fopen-vm-tools.git Add support to tools timeSync to issue w32tm resync in Windows guests. This change adds support to issue a w32tm resync command from within VMware tools timeSync in order to reconfigure w32time configuration parameters. This forces guest time to be resynchronized to external time server. --- diff --git a/open-vm-tools/services/plugins/timeSync/timeSync.c b/open-vm-tools/services/plugins/timeSync/timeSync.c index 060b42003..04e3d24c7 100644 --- a/open-vm-tools/services/plugins/timeSync/timeSync.c +++ b/open-vm-tools/services/plugins/timeSync/timeSync.c @@ -652,14 +652,14 @@ TimeSyncDoSync(Bool slewCorrection, TimeSync_IsGuestSyncServiceRunning()) { if (data->guestResyncTimer == NULL) { g_debug("Guest resync: stepping time.\n"); - if (!TimeSync_DoGuestResync()) { + ASSERT(data->ctx != NULL); + if (!TimeSync_DoGuestResync(data->ctx)) { g_warning("Guest resync operation failed.\n"); return TimeSyncDoSync(data->slewCorrection, TIMESYNC_STEP_NORESYNC, allowBackwardSync, data); } if (data->guestResyncTimeout > 0) { - ASSERT(data->ctx != NULL); data->guestResyncTimer = g_timeout_source_new(data->guestResyncTimeout); VMTOOLSAPP_ATTACH_SOURCE(data->ctx, data->guestResyncTimer, diff --git a/open-vm-tools/services/plugins/timeSync/timeSync.h b/open-vm-tools/services/plugins/timeSync/timeSync.h index 4ae665aa6..fc87c32c6 100644 --- a/open-vm-tools/services/plugins/timeSync/timeSync.h +++ b/open-vm-tools/services/plugins/timeSync/timeSync.h @@ -57,7 +57,7 @@ Bool TimeSync_IsGuestSyncServiceRunning(void); Bool -TimeSync_DoGuestResync(void); +TimeSync_DoGuestResync(void *_ctx); #endif /* _TIMESYNC_INT_H_ */ diff --git a/open-vm-tools/services/plugins/timeSync/timeSyncPosix.c b/open-vm-tools/services/plugins/timeSync/timeSyncPosix.c index 56bd2a704..8766a569d 100644 --- a/open-vm-tools/services/plugins/timeSync/timeSyncPosix.c +++ b/open-vm-tools/services/plugins/timeSync/timeSyncPosix.c @@ -147,7 +147,7 @@ TimeSync_IsGuestSyncServiceRunning(void) */ Bool -TimeSync_DoGuestResync(void) +TimeSync_DoGuestResync(void *_ctx) { // Not Implemented. return FALSE;