]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove the single VMware Tools User Process enforcement
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 18 Feb 2025 09:13:55 +0000 (01:13 -0800)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 18 Feb 2025 09:13:55 +0000 (01:13 -0800)
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

open-vm-tools/services/vmtoolsd/mainLoop.c
open-vm-tools/services/vmtoolsd/toolsRpc.c

index 44ab42655945a8e3876e9ece72dc18a521378ae7..4b3595058b168b2b2d0f181600ccef816b118f2f 100644 (file)
  * 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.
index f8ddd30fe8ed3f48d9462ad31f795090fa6a9ce8..3d4225519cb49a49d733cbf1fbacd344f3a78ee2 100644 (file)
 #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