From: VMware, Inc <> Date: Thu, 18 Nov 2010 22:17:46 +0000 (-0800) Subject: Reorder the resolution/topology capability list. X-Git-Tag: 2010.11.17-327185~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a9eb5edf4a4ae342f13bc34d25838e9e749cee4;p=thirdparty%2Fopen-vm-tools.git Reorder the resolution/topology capability list. Set the 'can do topolgy' ahead of the 'can do resolution' capability to avoid a host side race condition. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c b/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c index 8856faaf3..20fee00bc 100644 --- a/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c +++ b/open-vm-tools/services/plugins/resolutionSet/resolutionSet.c @@ -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