]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Reorder the resolution/topology capability list.
authorVMware, Inc <>
Thu, 18 Nov 2010 22:17:46 +0000 (14:17 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 18 Nov 2010 22:17:46 +0000 (14:17 -0800)
Set the 'can do topolgy' ahead of the 'can do resolution' capability to
avoid a host side race condition.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/resolutionSet/resolutionSet.c

index 8856faaf3c054f1093ba5037ce925dbceb60bf0a..20fee00bc6cfaf99287185a25720303ec7bba350 100644 (file)
@@ -437,29 +437,9 @@ ResolutionSetCapabilities(gpointer src,
    }
 
    /*
-    * If we can set the guest resolution, add the resolution_set capability to
-    * our array.
+    * XXX: We must register display_topology_set before resolution_set to avoid
+    *      a race condition in the host. See bug 472343.
     */
-   if (resInfo->canSetResolution) {
-      capabilityArray[capabilityCount].type  = TOOLS_CAP_OLD;
-      capabilityArray[capabilityCount].name  = "resolution_set";
-      capabilityArray[capabilityCount].index = 0;
-      capabilityArray[capabilityCount].value = set ? 1 : 0;
-      capabilityCount++;
-
-      /*
-       * Send the resolution_server RPC to the VMX.
-       *
-       * XXX: We need to send this ourselves, instead of including it in the
-       *      capability array, because the resolution_server RPC includes the
-       *      name of the RPC channel that the VMX should use when sending
-       *      resolution set RPCs as an argument.
-       */
-      if (ctx && ctx->rpc && ctx->isVMware) {
-         ResolutionSetServerCapability(ctx->rpc, set ? 1 : 0);
-      }
-   }
-
    /*
     * If we can set the guest topology, add the display_topology_set and
     * display_global_offset capabilities to our array.
@@ -483,6 +463,30 @@ ResolutionSetCapabilities(gpointer src,
       capabilityCount++;
    }
 
+   /*
+    * If we can set the guest resolution, add the resolution_set capability to
+    * our array.
+    */
+   if (resInfo->canSetResolution) {
+      capabilityArray[capabilityCount].type  = TOOLS_CAP_OLD;
+      capabilityArray[capabilityCount].name  = "resolution_set";
+      capabilityArray[capabilityCount].index = 0;
+      capabilityArray[capabilityCount].value = set ? 1 : 0;
+      capabilityCount++;
+
+      /*
+       * Send the resolution_server RPC to the VMX.
+       *
+       * XXX: We need to send this ourselves, instead of including it in the
+       *      capability array, because the resolution_server RPC includes the
+       *      name of the RPC channel that the VMX should use when sending
+       *      resolution set RPCs as an argument.
+       */
+      if (ctx && ctx->rpc && ctx->isVMware) {
+         ResolutionSetServerCapability(ctx->rpc, set ? 1 : 0);
+      }
+   }
+
 #if defined(RESOLUTION_WIN32)
    /*
     * XXX: I believe we can always handle these RPCs from the service, even on