]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not directly applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Sun, 1 Jan 2023 06:13:07 +0000 (22:13 -0800)
committerJohn Wolfe <jwolfe@vmware.com>
Sun, 1 Jan 2023 06:13:07 +0000 (22:13 -0800)
open-vm-tools/lib/include/conf.h
open-vm-tools/services/plugins/guestStore/guestStorePlugin.c
open-vm-tools/services/vmtoolsd/mainLoop.c

index b696d64b7ec51faa0fe8a5345f6a9ff388435882..11bc028c39ae178ee8d3cda18dd3cabbefaab584 100644 (file)
  */
 #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.
  *
index 5b084ecf2205e136cd8d21c8e56e4591d8c5546f..d3a213bed909a2d14f2c5030a47ffe4efaf652a7 100644 (file)
@@ -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();
index 2fd12bc3f00cbc6bff9bcf4c554f460baccff8f1..6277d3ee7dedf435b27e16cc2c2c66106553cd07 100644 (file)
@@ -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;
       }