]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
vmtoolsd: do not store VMX options with the rest of config
authorVMware, Inc <>
Thu, 17 Dec 2009 23:01:29 +0000 (15:01 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Dec 2009 23:01:29 +0000 (15:01 -0800)
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 <mvanzin@vmware.com>
open-vm-tools/services/vmtoolsd/toolsRpc.c

index 1670efdfe67a8a613bca13fbbde72e5e01839331..c583d0b204367e28ded1a42dc195a5ec1d9c9669 100644 (file)
@@ -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;
 }