From: Kruti Pendharkar Date: Tue, 18 Feb 2025 09:13:55 +0000 (-0800) Subject: Remove the single VMware Tools User Process enforcement X-Git-Tag: stable-13.1.0~244 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e529904963eefcd90f6e69e8cfb5b4362bd65cc0;p=thirdparty%2Fopen-vm-tools.git Remove the single VMware Tools User Process enforcement override condition. When the mechanism to enforce the single vmusr process per vm was established, a user configurable feature disablement switch 'maxChannelAttempts' (within tools.conf) was provided to override this restriction (to avoid any regression). Since this is no longer needed, removing the 'ToolsCore_GetVmusrLimit' function and avoid reading maxChannelAttempts from tools.conf --- diff --git a/open-vm-tools/services/vmtoolsd/mainLoop.c b/open-vm-tools/services/vmtoolsd/mainLoop.c index 44ab42655..4b3595058 100644 --- a/open-vm-tools/services/vmtoolsd/mainLoop.c +++ b/open-vm-tools/services/vmtoolsd/mainLoop.c @@ -77,26 +77,6 @@ * is not available. */ -/* - * Lowest number of RPC channel errors to reasonably indicate that the - * single allowed toolbox-dnd channel is currently in use by another - * process. - */ -#define VMUSR_CHANNEL_ERR_MIN 3 /* approximately 3 secs. */ - -/* - * The default number of vmusr channel errors before quitting the vmusr - * process start-up. - */ -#define VMUSR_CHANNEL_ERR_DEFAULT 5 /* approximately 5 secs. */ - -/* - * Arbitrary upper vmusr channel error count limit. - */ -#define VMUSR_CHANNEL_ERR_MAX 15 /* approximately 15 secs. */ - -#define CONFNAME_MAX_CHANNEL_ATTEMPTS "maxChannelAttempts" - #if defined(GLOBALCONFIG_SUPPORTED) /* * The state of the global conf module. @@ -638,45 +618,6 @@ ToolsCore_DumpState(ToolsServiceState *state) &state->ctx); } - -/** - * Return the RpcChannel failure threshold for the tools user service. - * - * @param[in] state The service state. - * - * @return The RpcChannel failure limit for the user tools service. - */ - -guint -ToolsCore_GetVmusrLimit(ToolsServiceState *state) // IN -{ - gint errorLimit = 0; /* Special value 0 means no error threshold. */ - - if (TOOLS_IS_USER_SERVICE(state)) { - errorLimit = VMTools_ConfigGetInteger(state->ctx.config, - state->name, - CONFNAME_MAX_CHANNEL_ATTEMPTS, - VMUSR_CHANNEL_ERR_DEFAULT); - - /* - * A zero value is allowed and will disable the single vmusr - * process restriction. - */ - if (errorLimit != 0 && - (errorLimit < VMUSR_CHANNEL_ERR_MIN || - errorLimit > VMUSR_CHANNEL_ERR_MAX)) { - g_warning("%s: Invalid %s: %s (%d) specified in tools configuration; " - "using default value (%d)\n", __FUNCTION__, - state->name, CONFNAME_MAX_CHANNEL_ATTEMPTS, - errorLimit, VMUSR_CHANNEL_ERR_DEFAULT); - errorLimit = VMUSR_CHANNEL_ERR_DEFAULT; - } - } - - return errorLimit; -} - - /** * Returns the name of the TCLO app name. This will only return non-NULL * if the service is either the tools "guestd" or "userd" service. diff --git a/open-vm-tools/services/vmtoolsd/toolsRpc.c b/open-vm-tools/services/vmtoolsd/toolsRpc.c index f8ddd30fe..3d4225519 100644 --- a/open-vm-tools/services/vmtoolsd/toolsRpc.c +++ b/open-vm-tools/services/vmtoolsd/toolsRpc.c @@ -46,6 +46,12 @@ #include "vmci_sockets.h" #endif +/* + * The number of RPC channel errors to reasonably indicate that the single allowed toolbox-dnd + * channel is currently in use by another process vmusr channel errors before quitting the vmusr + * process start-up. Value used to quit vmusr process at start-up + */ +#define VMUSR_CHANNEL_MAX_RPC_ERRS 5 /** @@ -405,11 +411,10 @@ ToolsCore_InitRpc(ToolsServiceState *state) size_t i; #if !defined(_WIN32) - /* For the *nix user service app. */ if (TOOLS_IS_USER_SERVICE(state)) { failureCb = ToolsCoreAppChannelFail; - errorLimit = ToolsCore_GetVmusrLimit(state); + errorLimit = VMUSR_CHANNEL_MAX_RPC_ERRS; } #endif