From: VMware, Inc <> Date: Thu, 17 Dec 2009 23:01:29 +0000 (-0800) Subject: vmtoolsd: do not store VMX options with the rest of config X-Git-Tag: 2009.12.16-217847~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fda6eb72996b4bb3e97495e86a0cb32acfe7da61;p=thirdparty%2Fopen-vm-tools.git vmtoolsd: do not store VMX options with the rest of config VMX options are not persistent in the sense that they are not stored in tools config file in GOS but rather [re]transmitted from host at startup, resume, etc, or when they are changed. When we reload config file (which we periodically do to switch to the latest and greatest user-supplied settings) VMX options get flushed from memory so let's not put them in key file in first place and instead require plugins to store values relevant to their operation themselves. The only user who did look up VMX option in key file - timeSync - has already been changed to store value by itself. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/services/vmtoolsd/toolsRpc.c b/open-vm-tools/services/vmtoolsd/toolsRpc.c index 1670efdfe..c583d0b20 100644 --- a/open-vm-tools/services/vmtoolsd/toolsRpc.c +++ b/open-vm-tools/services/vmtoolsd/toolsRpc.c @@ -182,28 +182,22 @@ ToolsCoreRpcSetOption(RpcInData *data) index++; value = StrUtil_GetNextToken(&index, data->args, ""); - if (option == NULL || value == NULL || strlen(value) == 0) { - goto exit; - } - - g_debug("Setting option '%s' to '%s'.\n", option, value); - g_key_file_set_string(state->ctx.config, state->ctx.name, option, value); + if (option != NULL && value != NULL && strlen(value) != 0) { - g_signal_emit_by_name(state->ctx.serviceObj, - TOOLS_CORE_SIG_SET_OPTION, - &state->ctx, - option, - value, - &retVal); + g_debug("Setting option '%s' to '%s'.\n", option, value); + g_signal_emit_by_name(state->ctx.serviceObj, + TOOLS_CORE_SIG_SET_OPTION, + &state->ctx, + option, + value, + &retVal); + } -exit: vm_free(option); vm_free(value); - if (retVal) { - RPCIN_SETRETVALS(data, "", retVal); - } else { - RPCIN_SETRETVALS(data, "Unknown or invalid option", retVal); - } + + RPCIN_SETRETVALS(data, retVal ? "" : "Unknown or invalid option", retVal); + return retVal; }