]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
ToolsCore: Signal config file reloads.
authorVMware, Inc <>
Mon, 28 Sep 2009 20:21:33 +0000 (13:21 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 28 Sep 2009 20:21:33 +0000 (13:21 -0700)
This change introduces a new signal, tcs_conf_reload, which is emitted
in response to a successful config file reload.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/include/vmtoolsApp.h
open-vm-tools/services/vmtoolsd/mainLoop.c
open-vm-tools/services/vmtoolsd/serviceObj.c

index 6a00c5a860322bd34c4cee660310589f941936d1..9c264f12f2528afef5cfdd039cb764499228d867 100644 (file)
  */
 #define TOOLS_CORE_SIG_CAPABILITIES "tcs_capabilities"
 
+/**
+ * Signal sent when the config file is reloaded.
+ *
+ * @param[in]  src      The source object.
+ * @param[in]  ctx      ToolsAppCtx *: The application context.
+ * @param[in]  data     Client data.
+ */
+#define TOOLS_CORE_SIG_CONF_RELOAD "tcs_conf_reload"
+
 /**
  * Signal sent when the service receives a request to dump its internal
  * state to the log. This is for debugging purposes, and plugins can
index 4c6bbfc8df45a2a3187ae006d6ee85070c7edb55..bb6faf27f9b7fdb9afb1910466b35790d22a4b42 100644 (file)
@@ -232,6 +232,11 @@ ToolsCore_ReloadConfig(ToolsServiceState *state,
                                    &state->ctx.config,
                                    &state->configMtime)) {
       g_debug("Config file reloaded.\n");
+
+      /* Inform plugins of config file update. */
+      g_signal_emit_by_name(state->ctx.serviceObj,
+                            TOOLS_CORE_SIG_CONF_RELOAD,
+                            &state->ctx);
    } else {
       loaded = FALSE;
    }
index 0b75b6fd2b29b7da3da470e489f62e02e53000e5..4d2e4625791d43c315733db80c5455b50eef243f 100644 (file)
@@ -116,6 +116,16 @@ ToolsCore_Service_class_init(gpointer _klass,
                 2,
                 G_TYPE_POINTER,
                 G_TYPE_BOOLEAN);
+   g_signal_new(TOOLS_CORE_SIG_CONF_RELOAD,
+                G_OBJECT_CLASS_TYPE(klass),
+                G_SIGNAL_RUN_LAST,
+                0,
+                NULL,
+                NULL,
+                g_cclosure_marshal_VOID__POINTER,
+                G_TYPE_NONE,
+                1,
+                G_TYPE_POINTER);
    g_signal_new(TOOLS_CORE_SIG_DUMP_STATE,
                 G_OBJECT_CLASS_TYPE(klass),
                 G_SIGNAL_RUN_LAST,