From: John Wolfe Date: Sun, 1 Jan 2023 06:13:07 +0000 (-0800) Subject: Changes to common source files not directly applicable to open-vm-tools. X-Git-Tag: stable-12.2.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11d107a07440c8cd97f4a3c34b8664a2089812ac;p=thirdparty%2Fopen-vm-tools.git Changes to common source files not directly applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/include/conf.h b/open-vm-tools/lib/include/conf.h index b696d64b7..11bc028c3 100644 --- a/open-vm-tools/lib/include/conf.h +++ b/open-vm-tools/lib/include/conf.h @@ -275,16 +275,6 @@ */ #define CONFNAME_GSUPGRADE_POLLINTERVAL "poll-interval" -/** - * Define a custom GuestStore periodic Upgrade interval (in seconds). - * - * @note Illegal values result in a @c g_warning and fallback to the default - * upgrade interval. - * - * @param int User-defined upgrade interval. Set to 0 to disable polling. - */ -#define CONFNAME_GSUPGRADE_UPGRADEINTERVAL "upgrade-interval" - /** * Define a custom GuestStore content path prefix. * diff --git a/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c b/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c index 5b084ecf2..d3a213bed 100644 --- a/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c +++ b/open-vm-tools/services/plugins/guestStore/guestStorePlugin.c @@ -2934,17 +2934,13 @@ GuestStoreReset(gpointer src, // IN #endif } else if (pluginData.vmxConnectRequested) { /* - * Closing pluginData.vmxListenSock cancels pending VmxConnectCb() call, - * second call of AsyncSocket_ListenVMCI() results in a new vsocket - * listening port number. + * GuestStoreAccessDisable() closes pluginData.vmxListensock, which + * cancels any pending VmxConnectCb() call. + * GuestStoreAccessDisable() also calls StopVmxToGuestConnTimeout(). */ g_info("Perform tools reset without VMX connection " "but VMX connect request was made.\n"); - GuestStoreAccessDisable(); // Calls StopVmxToGuestConnTimeout() - if (pluginData.guestStoreAccessEnabled && - !CheckAndUpdateFeatureDisabled()) { - GuestStoreAccessEnable(); - } + GuestStoreAccessDisable(); } } @@ -2957,7 +2953,7 @@ GuestStoreReset(gpointer src, // IN * Handle TOOLSOPTION_ENABLE_GUESTSTORE_ACCESS Set_Option callback. * * Results: - * TRUE on success. + * TRUE if action is taken on the signal. * * Side-effects: * None @@ -2980,7 +2976,7 @@ GuestStoreSetOption(gpointer src, // IN if (strcmp(value, "1") == 0 && !pluginData.guestStoreAccessEnabled) { - if (CheckAndUpdateFeatureDisabled()) { + if (pluginData.featureDisabled) { // Use cached state here g_info("GuestStore access is deactivated on guest side.\n"); } else { GuestStoreAccessEnable(); diff --git a/open-vm-tools/services/vmtoolsd/mainLoop.c b/open-vm-tools/services/vmtoolsd/mainLoop.c index 2fd12bc3f..6277d3ee7 100644 --- a/open-vm-tools/services/vmtoolsd/mainLoop.c +++ b/open-vm-tools/services/vmtoolsd/mainLoop.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2021 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2022 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -52,7 +52,7 @@ #endif /* - * guestStoreClient library is needed for both Gueststore based tools upgrade + * guestStoreClient library is needed for both GuestStore-based tools upgrade * and also for GlobalConfig module. */ #if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) @@ -137,11 +137,11 @@ ToolsCoreCleanup(ToolsServiceState *state) } #endif -/* - * guestStoreClient library is needed for both Gueststore based tools upgrade - * and also for GlobalConfig module. - */ #if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) + /* + * guestStoreClient library is needed for both GuestStore-based tools + * upgrade and also for GlobalConfig module. + */ if (state->mainService && GuestStoreClient_DeInit()) { g_info("%s: De-initialized GuestStore client.\n", __FUNCTION__); } @@ -461,11 +461,22 @@ ToolsCoreRunLoop(ToolsServiceState *state) ToolsCoreReportVersionData(state); } -/* - * guestStoreClient library is needed for both Gueststore based tools upgrade - * and also for GlobalConfig module. - */ +#if defined(_WIN32) + /* + * Call ToolsNotify_Start() to create the global VMToolsNeedReboot event + * before loading plugins so that plugins can open the event in their init + * routines. + */ + if (state->mainService && ToolsNotify_Start(&state->ctx)) { + g_info("%s: Successfully started tools notifications.\n", __FUNCTION__); + } +#endif + #if defined(_WIN32) || defined(GLOBALCONFIG_SUPPORTED) + /* + * guestStoreClient library is needed for both GuestStore-based tools + * upgrade and also for GlobalConfig module. + */ if (state->mainService && GuestStoreClient_Init()) { g_info("%s: Initialized GuestStore client.\n", __FUNCTION__); } @@ -541,20 +552,14 @@ ToolsCoreRunLoop(ToolsServiceState *state) */ if (state->mainService) { if (ToolsCoreHangDetector_Start(&state->ctx)) { - g_info("%s: Successfully started tools hang detector", + g_info("%s: Successfully started tools hang detector.\n", __FUNCTION__); } -#if defined(_WIN32) - if (ToolsNotify_Start(&state->ctx)) { - g_info("%s: Successfully started tools notifications", - __FUNCTION__); - } -#endif } #if defined(GLOBALCONFIG_SUPPORTED) if (GlobalConfig_Start(&state->ctx)) { - g_info("%s: Successfully started global config module.", + g_info("%s: Successfully started global config module.\n", __FUNCTION__); gGlobalConfStarted = TRUE; }